From 256070339f557e295c1e90e9a451c82731d5c223 Mon Sep 17 00:00:00 2001 From: Michael Denkowski Date: Thu, 6 Mar 2014 15:35:10 -0800 Subject: Compile count-based bilex table for online grammar extraction. --- python/cdec/sa/__init__.py | 1 + python/cdec/sa/_sa.cpp | 1487 +++++++++++++++++++++------------------- python/cdec/sa/compile.py | 17 + python/cdec/sa/extract.py | 8 +- python/cdec/sa/extractor.py | 8 +- python/cdec/sa/features.py | 6 - python/cdec/sa/online.py | 95 +++ python/cdec/sa/rulefactory.pxi | 9 +- 8 files changed, 902 insertions(+), 729 deletions(-) create mode 100644 python/cdec/sa/online.py (limited to 'python/cdec/sa') diff --git a/python/cdec/sa/__init__.py b/python/cdec/sa/__init__.py index 14ba5ecb..0c132cb9 100644 --- a/python/cdec/sa/__init__.py +++ b/python/cdec/sa/__init__.py @@ -3,6 +3,7 @@ from cdec.sa._sa import make_lattice, decode_lattice, decode_sentence,\ SuffixArray, DataArray, LCP, Precomputation, Alignment, BiLex,\ HieroCachingRuleFactory, Sampler, Scorer from cdec.sa.extractor import GrammarExtractor +import online _SA_FEATURES = [] _SA_ANNOTATORS = {} diff --git a/python/cdec/sa/_sa.cpp b/python/cdec/sa/_sa.cpp index c59fa22b..6e8b0a6f 100644 --- a/python/cdec/sa/_sa.cpp +++ b/python/cdec/sa/_sa.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.19.2 on Mon Mar 3 08:00:58 2014 */ +/* Generated by Cython 0.19.2 on Thu Mar 6 14:00:22 2014 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS @@ -710,7 +710,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2144 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2149 * * # Rule string from rule * def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<< @@ -863,7 +863,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2163 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168 * # (Used for EGivenFCoherent) * # Return set of (fphrase, lex_i, lex_j) * def get_f_phrases(self, f_words): # <<<<<<<<<<<<<< @@ -1019,7 +1019,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2140 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<< @@ -1281,7 +1281,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2150 * # Rule string from rule * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<< @@ -1332,7 +1332,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2079 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2084 * * # Create a rule from source, target, non-terminals, and alignments * def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<< @@ -61846,6 +61846,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc PyObject *__pyx_v_e_ph = NULL; PyObject *__pyx_v_aligned_fe = NULL; PyObject *__pyx_v_aligned_ef = NULL; + int __pyx_v_null_word; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_j = NULL; PyObject *__pyx_v_e_i_aligned = NULL; @@ -61871,6 +61872,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc Py_ssize_t __pyx_t_14; PyObject *(*__pyx_t_15)(PyObject *); PyObject *__pyx_t_16 = NULL; + int __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -62925,7 +62927,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc * # Update Bilexical counts * aligned_fe = [list() for _ in range(len(f_words))] # <<<<<<<<<<<<<< * aligned_ef = [list() for _ in range(len(e_words))] - * for (i, j) in alignment: + * null_word = sym_fromstring('NULL', True) */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -62993,8 +62995,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc * # Update Bilexical counts * aligned_fe = [list() for _ in range(len(f_words))] * aligned_ef = [list() for _ in range(len(e_words))] # <<<<<<<<<<<<<< + * null_word = sym_fromstring('NULL', True) * for (i, j) in alignment: - * aligned_fe[i].append(j) */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -63061,6 +63063,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2060 * aligned_fe = [list() for _ in range(len(f_words))] * aligned_ef = [list() for _ in range(len(e_words))] + * null_word = sym_fromstring('NULL', True) # <<<<<<<<<<<<<< + * for (i, j) in alignment: + * aligned_fe[i].append(j) + */ + __pyx_v_null_word = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_k__NULL, 1); + + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2061 + * aligned_ef = [list() for _ in range(len(e_words))] + * null_word = sym_fromstring('NULL', True) * for (i, j) in alignment: # <<<<<<<<<<<<<< * aligned_fe[i].append(j) * aligned_ef[j].append(i) @@ -63069,7 +63080,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_t_4 = __pyx_v_alignment; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; } @@ -63077,23 +63088,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63109,7 +63120,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -63122,16 +63133,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __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; @@ -63139,7 +63150,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L31_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L32_unpacking_done; @@ -63147,7 +63158,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L32_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); @@ -63155,62 +63166,62 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2061 - * aligned_ef = [list() for _ in range(len(e_words))] + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2062 + * null_word = sym_fromstring('NULL', True) * for (i, j) in alignment: * aligned_fe[i].append(j) # <<<<<<<<<<<<<< * aligned_ef[j].append(i) * for f_i in range(len(f_words)): */ - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_fe), __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_fe), __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2062 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2063 * for (i, j) in alignment: * aligned_fe[i].append(j) * aligned_ef[j].append(i) # <<<<<<<<<<<<<< * for f_i in range(len(f_words)): - * e_i_aligned = aligned_fe[f_i] + * stats.bilex_f[f_words[f_i]] += 1 */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_ef), __pyx_v_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_ef), __pyx_v_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __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; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2063 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2064 * aligned_fe[i].append(j) * aligned_ef[j].append(i) * for f_i in range(len(f_words)): # <<<<<<<<<<<<<< + * stats.bilex_f[f_words[f_i]] += 1 * e_i_aligned = aligned_fe[f_i] - * lc = len(e_i_aligned) */ __pyx_t_4 = __pyx_cur_scope->__pyx_v_f_words; __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __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[8]; __pyx_lineno = 2063; __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 = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -63219,23 +63230,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63244,76 +63255,76 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2064 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2065 * aligned_ef[j].append(i) * for f_i in range(len(f_words)): + * stats.bilex_f[f_words[f_i]] += 1 # <<<<<<<<<<<<<< + * e_i_aligned = aligned_fe[f_i] + * lc = len(e_i_aligned) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_t_1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyObject_SetItem(__pyx_t_4, __pyx_t_1, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2066 + * for f_i in range(len(f_words)): + * stats.bilex_f[f_words[f_i]] += 1 * e_i_aligned = aligned_fe[f_i] # <<<<<<<<<<<<<< * lc = len(e_i_aligned) * if lc > 0: */ - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_fe), __pyx_v_f_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_fe), __pyx_v_f_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_e_i_aligned, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2065 - * for f_i in range(len(f_words)): + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2067 + * stats.bilex_f[f_words[f_i]] += 1 * e_i_aligned = aligned_fe[f_i] * lc = len(e_i_aligned) # <<<<<<<<<<<<<< * if lc > 0: - * stats.bilex_f[f_words[f_i]] += 1 + * for e_i in e_i_aligned: */ - __pyx_t_14 = PyObject_Length(__pyx_v_e_i_aligned); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Length(__pyx_v_e_i_aligned); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_lc, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2066 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2068 * e_i_aligned = aligned_fe[f_i] * lc = len(e_i_aligned) * if lc > 0: # <<<<<<<<<<<<<< - * stats.bilex_f[f_words[f_i]] += 1 * for e_i in e_i_aligned: + * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_lc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_lc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2067 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2069 * lc = len(e_i_aligned) * if lc > 0: - * stats.bilex_f[f_words[f_i]] += 1 # <<<<<<<<<<<<<< - * for e_i in e_i_aligned: - * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_t_1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetItem(__pyx_t_4, __pyx_t_1, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2068 - * if lc > 0: - * stats.bilex_f[f_words[f_i]] += 1 * for e_i in e_i_aligned: # <<<<<<<<<<<<<< * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc - * for e_i in range(len(e_words)): + * else: */ if (PyList_CheckExact(__pyx_v_e_i_aligned) || PyTuple_CheckExact(__pyx_v_e_i_aligned)) { __pyx_t_4 = __pyx_v_e_i_aligned; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0; __pyx_t_15 = NULL; } else { - __pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_e_i_aligned); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_e_i_aligned); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext; } @@ -63321,23 +63332,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_1 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63346,35 +63357,35 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_XDECREF_SET(__pyx_v_e_i, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2069 - * stats.bilex_f[f_words[f_i]] += 1 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2070 + * if lc > 0: * for e_i in e_i_aligned: * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc # <<<<<<<<<<<<<< - * for e_i in range(len(e_words)): - * f_i_aligned = aligned_ef[e_i] + * else: + * stats.bilex_fe[f_words[f_i]][null_word] += 1 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_t_7); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_t_7); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_GetItem(__pyx_t_6, __pyx_t_7); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_t_6, __pyx_t_7); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_t_13, __pyx_v_lc); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_t_13, __pyx_v_lc); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_16); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_16); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_t_7, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_6, __pyx_t_7, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -63382,61 +63393,88 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L35; } + /*else*/ { + + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2072 + * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc + * else: + * stats.bilex_fe[f_words[f_i]][null_word] += 1 # <<<<<<<<<<<<<< + * for e_i in range(len(e_words)): + * stats.bilex_e[e_words[e_i]] += 1 + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_t_6); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = __pyx_v_null_word; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, __pyx_t_17, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_SetItemInt(__pyx_t_7, __pyx_t_17, __pyx_t_4, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } __pyx_L35:; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2070 - * for e_i in e_i_aligned: - * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2073 + * else: + * stats.bilex_fe[f_words[f_i]][null_word] += 1 * for e_i in range(len(e_words)): # <<<<<<<<<<<<<< + * stats.bilex_e[e_words[e_i]] += 1 * f_i_aligned = aligned_ef[e_i] - * lc = len(f_i_aligned) */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __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[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = Py_TYPE(__pyx_t_7)->tp_iternext; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_4)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_7)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_4)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_7)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_4); + __pyx_t_3 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63445,76 +63483,76 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_XDECREF_SET(__pyx_v_e_i, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2071 - * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2074 + * stats.bilex_fe[f_words[f_i]][null_word] += 1 * for e_i in range(len(e_words)): + * stats.bilex_e[e_words[e_i]] += 1 # <<<<<<<<<<<<<< + * f_i_aligned = aligned_ef[e_i] + * lc = len(f_i_aligned) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_e); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2075 + * for e_i in range(len(e_words)): + * stats.bilex_e[e_words[e_i]] += 1 * f_i_aligned = aligned_ef[e_i] # <<<<<<<<<<<<<< * lc = len(f_i_aligned) * if lc > 0: */ - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_ef), __pyx_v_e_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_ef), __pyx_v_e_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_f_i_aligned, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2072 - * for e_i in range(len(e_words)): + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2076 + * stats.bilex_e[e_words[e_i]] += 1 * f_i_aligned = aligned_ef[e_i] * lc = len(f_i_aligned) # <<<<<<<<<<<<<< * if lc > 0: - * stats.bilex_e[e_words[e_i]] += 1 + * for f_i in f_i_aligned: */ - __pyx_t_14 = PyObject_Length(__pyx_v_f_i_aligned); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Length(__pyx_v_f_i_aligned); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_lc, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2073 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2077 * f_i_aligned = aligned_ef[e_i] * lc = len(f_i_aligned) * if lc > 0: # <<<<<<<<<<<<<< - * stats.bilex_e[e_words[e_i]] += 1 * for f_i in f_i_aligned: + * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_lc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_lc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2074 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2078 * lc = len(f_i_aligned) * if lc > 0: - * stats.bilex_e[e_words[e_i]] += 1 # <<<<<<<<<<<<<< - * for f_i in f_i_aligned: - * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_e); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_t_6, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2075 - * if lc > 0: - * stats.bilex_e[e_words[e_i]] += 1 * for f_i in f_i_aligned: # <<<<<<<<<<<<<< * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc - * + * else: */ if (PyList_CheckExact(__pyx_v_f_i_aligned) || PyTuple_CheckExact(__pyx_v_f_i_aligned)) { __pyx_t_3 = __pyx_v_f_i_aligned; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0; __pyx_t_15 = NULL; } else { - __pyx_t_14 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_f_i_aligned); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_f_i_aligned); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -63522,70 +63560,97 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_6); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_6); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_6 = __pyx_t_15(__pyx_t_3); - if (unlikely(!__pyx_t_6)) { + __pyx_t_4 = __pyx_t_15(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_6); - __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_4); + __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2076 - * stats.bilex_e[e_words[e_i]] += 1 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2079 + * if lc > 0: * for f_i in f_i_aligned: * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc # <<<<<<<<<<<<<< - * - * # Create a rule from source, target, non-terminals, and alignments + * else: + * stats.bilex_ef[e_words[e_i]][null_word] += 1 */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_ef); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_ef); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_7 = PyObject_GetItem(__pyx_t_6, __pyx_t_13); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_t_13); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_6 = PyObject_GetItem(__pyx_t_7, __pyx_t_13); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_16 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_t_6, __pyx_t_13); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_16, __pyx_v_lc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_16, __pyx_v_lc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_t_13, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_6, __pyx_t_13, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L40; } + /*else*/ { + + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2081 + * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc + * else: + * stats.bilex_ef[e_words[e_i]][null_word] += 1 # <<<<<<<<<<<<<< + * + * # Create a rule from source, target, non-terminals, and alignments + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_ef); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = __pyx_v_null_word; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_13, __pyx_t_17, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_SetItemInt(__pyx_t_13, __pyx_t_17, __pyx_t_3, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } __pyx_L40:; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -63665,31 +63730,31 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_span)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_span)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__al)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "form_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "form_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -63710,7 +63775,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -63753,11 +63818,11 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda8") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda8") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -63770,7 +63835,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -63781,7 +63846,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2082 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2087 * * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<< @@ -63800,11 +63865,11 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda8", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __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[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __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); @@ -63812,7 +63877,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -63865,11 +63930,11 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda9") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda9") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -63882,7 +63947,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -63893,7 +63958,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2106 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2111 * # Adjusting alignment links takes some doing * links = [list(link) for sub in al for link in sub] * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<< @@ -63912,11 +63977,11 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda9", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __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[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __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); @@ -63924,7 +63989,7 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -63946,7 +64011,7 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self } static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2140 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<< @@ -63972,7 +64037,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2g __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -64016,19 +64081,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __Pyx_RaiseClosureNameError("links"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __Pyx_RaiseClosureNameError("links"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; @@ -64040,7 +64105,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -64053,16 +64118,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; @@ -64070,7 +64135,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; @@ -64078,7 +64143,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); @@ -64089,10 +64154,10 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_j, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment->__pyx_vtab)->link(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment, __pyx_t_8, __pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment->__pyx_vtab)->link(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment, __pyx_t_8, __pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -64109,7 +64174,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetNone(PyExc_StopIteration); @@ -64129,7 +64194,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2079 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2084 * * # Create a rule from source, target, non-terminals, and alignments * def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<< @@ -64186,52 +64251,52 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2082 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2087 * * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<< * f_sym = list(f_span[:]) * off = f_i */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_nt); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nt); __Pyx_GIVEREF(__pyx_v_nt); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_nt_inv = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2083 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2088 * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) # <<<<<<<<<<<<<< * off = f_i * for next_nt in nt: */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_f_span, 0, 0, NULL, NULL, &__pyx_k_slice_148, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_f_span, 0, 0, NULL, NULL, &__pyx_k_slice_148, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __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 = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); 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*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_f_sym = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2084 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2089 * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) * off = f_i # <<<<<<<<<<<<<< @@ -64241,7 +64306,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_f_i); __pyx_v_off = __pyx_v_f_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2085 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2090 * f_sym = list(f_span[:]) * off = f_i * for next_nt in nt: # <<<<<<<<<<<<<< @@ -64252,7 +64317,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_t_3 = __pyx_v_nt; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -64260,23 +64325,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64285,28 +64350,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2086 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2091 * off = f_i * for next_nt in nt: * nt_len = (next_nt[2] - next_nt[1]) + 1 # <<<<<<<<<<<<<< * i = 0 * while i < nt_len: */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2087 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2092 * for next_nt in nt: * nt_len = (next_nt[2] - next_nt[1]) + 1 * i = 0 # <<<<<<<<<<<<<< @@ -64316,7 +64381,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2088 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2093 * nt_len = (next_nt[2] - next_nt[1]) + 1 * i = 0 * while i < nt_len: # <<<<<<<<<<<<<< @@ -64324,82 +64389,82 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * i += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2089 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2094 * i = 0 * while i < nt_len: * f_sym.pop(next_nt[1] - off) # <<<<<<<<<<<<<< * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __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_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2090 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2095 * while i < nt_len: * f_sym.pop(next_nt[1] - off) * i += 1 # <<<<<<<<<<<<<< * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2091 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2096 * f_sym.pop(next_nt[1] - off) * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<< * off += (nt_len - 1) * e_sym = list(e_span[:]) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2092 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2097 * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) # <<<<<<<<<<<<<< * e_sym = list(e_span[:]) * off = e_i */ - __pyx_t_6 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2); @@ -64407,27 +64472,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2093 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2098 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) * e_sym = list(e_span[:]) # <<<<<<<<<<<<<< * off = e_i * for next_nt in nt_inv: */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_e_span, 0, 0, NULL, NULL, &__pyx_k_slice_149, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_e_span, 0, 0, NULL, NULL, &__pyx_k_slice_149, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __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 = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); 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*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_e_sym = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2094 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2099 * off += (nt_len - 1) * e_sym = list(e_span[:]) * off = e_i # <<<<<<<<<<<<<< @@ -64437,7 +64502,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_e_i); __Pyx_DECREF_SET(__pyx_v_off, __pyx_v_e_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2095 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2100 * e_sym = list(e_span[:]) * off = e_i * for next_nt in nt_inv: # <<<<<<<<<<<<<< @@ -64448,7 +64513,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_t_3 = __pyx_v_nt_inv; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt_inv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt_inv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -64456,23 +64521,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64481,28 +64546,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2096 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2101 * off = e_i * for next_nt in nt_inv: * nt_len = (next_nt[4] - next_nt[3]) + 1 # <<<<<<<<<<<<<< * i = 0 * while i < nt_len: */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __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_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2097 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2102 * for next_nt in nt_inv: * nt_len = (next_nt[4] - next_nt[3]) + 1 * i = 0 # <<<<<<<<<<<<<< @@ -64512,7 +64577,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2098 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2103 * nt_len = (next_nt[4] - next_nt[3]) + 1 * i = 0 * while i < nt_len: # <<<<<<<<<<<<<< @@ -64520,82 +64585,82 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * i += 1 */ while (1) { - __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2099 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2104 * i = 0 * while i < nt_len: * e_sym.pop(next_nt[3] - off) # <<<<<<<<<<<<<< * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __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 = 2104; __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_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2100 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105 * while i < nt_len: * e_sym.pop(next_nt[3] - off) * i += 1 # <<<<<<<<<<<<<< * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2101 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2106 * e_sym.pop(next_nt[3] - off) * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<< * off += (nt_len - 1) * */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2102 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2107 * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) # <<<<<<<<<<<<<< * * # Adjusting alignment links takes some doing */ - __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2); @@ -64603,20 +64668,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110 * * # Adjusting alignment links takes some doing * links = [list(link) for sub in al for link in sub] # <<<<<<<<<<<<<< * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) * links_len = len(links) */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __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 = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyList_CheckExact(__pyx_v_al) || PyTuple_CheckExact(__pyx_v_al)) { __pyx_t_2 = __pyx_v_al; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_al); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_al); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -64624,23 +64689,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64652,7 +64717,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_t_1 = __pyx_v_sub; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -64660,23 +64725,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_6 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_6)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64684,15 +64749,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_link); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_link); __Pyx_GIVEREF(__pyx_v_link); - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -64702,32 +64767,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_cur_scope->__pyx_v_links = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2106 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2111 * # Adjusting alignment links takes some doing * links = [list(link) for sub in al for link in sub] * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<< * links_len = len(links) * nt_len = len(nt) */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __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 = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_links)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_links)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_links)); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_links_inv = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2107 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2112 * links = [list(link) for sub in al for link in sub] * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) * links_len = len(links) # <<<<<<<<<<<<<< @@ -64738,29 +64803,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_links_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2108 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2113 * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) * links_len = len(links) * nt_len = len(nt) # <<<<<<<<<<<<<< * nt_i = 0 * off = f_i */ - __pyx_t_4 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2109 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2114 * links_len = len(links) * nt_len = len(nt) * nt_i = 0 # <<<<<<<<<<<<<< @@ -64770,7 +64835,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __pyx_v_nt_i = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2115 * nt_len = len(nt) * nt_i = 0 * off = f_i # <<<<<<<<<<<<<< @@ -64780,7 +64845,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_f_i); __Pyx_DECREF_SET(__pyx_v_off, __pyx_v_f_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2111 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2116 * nt_i = 0 * off = f_i * i = 0 # <<<<<<<<<<<<<< @@ -64790,7 +64855,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2112 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2117 * off = f_i * i = 0 * while i < links_len: # <<<<<<<<<<<<<< @@ -64798,12 +64863,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * off += (nt[nt_i][2] - nt[nt_i][1]) */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2113 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2118 * i = 0 * while i < links_len: * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: # <<<<<<<<<<<<<< @@ -64811,24 +64876,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * nt_i += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __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_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_14 = __pyx_t_13; } else { @@ -64836,79 +64901,79 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } if (!__pyx_t_14) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2114 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2119 * while i < links_len: * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: * off += (nt[nt_i][2] - nt[nt_i][1]) # <<<<<<<<<<<<<< * nt_i += 1 * links[i][0] -= off */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __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_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __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; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2115 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2120 * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: * off += (nt[nt_i][2] - nt[nt_i][1]) * nt_i += 1 # <<<<<<<<<<<<<< * links[i][0] -= off * i += 1 */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2116 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2121 * off += (nt[nt_i][2] - nt[nt_i][1]) * nt_i += 1 * links[i][0] -= off # <<<<<<<<<<<<<< * i += 1 * nt_i = 0 */ - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_4, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_4, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2117 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2122 * nt_i += 1 * links[i][0] -= off * i += 1 # <<<<<<<<<<<<<< * nt_i = 0 * off = e_i */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2118 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2123 * links[i][0] -= off * i += 1 * nt_i = 0 # <<<<<<<<<<<<<< @@ -64918,7 +64983,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2119 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2124 * i += 1 * nt_i = 0 * off = e_i # <<<<<<<<<<<<<< @@ -64928,7 +64993,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_e_i); __Pyx_DECREF_SET(__pyx_v_off, __pyx_v_e_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2120 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2125 * nt_i = 0 * off = e_i * i = 0 # <<<<<<<<<<<<<< @@ -64938,7 +65003,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2121 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2126 * off = e_i * i = 0 * while i < links_len: # <<<<<<<<<<<<<< @@ -64946,12 +65011,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) */ while (1) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_14) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2122 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2127 * i = 0 * while i < links_len: * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: # <<<<<<<<<<<<<< @@ -64959,24 +65024,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * nt_i += 1 */ while (1) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_14) { - __pyx_t_2 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __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_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__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 = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = __pyx_t_7; } else { @@ -64984,79 +65049,79 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } if (!__pyx_t_13) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2123 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2128 * while i < links_len: * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) # <<<<<<<<<<<<<< * nt_i += 1 * links_inv[i][1] -= off */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __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_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2124 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2129 * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) * nt_i += 1 # <<<<<<<<<<<<<< * links_inv[i][1] -= off * i += 1 */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_t_3); __pyx_t_3 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2125 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2130 * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) * nt_i += 1 * links_inv[i][1] -= off # <<<<<<<<<<<<<< * i += 1 * */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetItemInt(__pyx_t_3, __pyx_t_4, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_3, __pyx_t_4, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2126 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2131 * nt_i += 1 * links_inv[i][1] -= off * i += 1 # <<<<<<<<<<<<<< * * # Find lexical span */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2129 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2134 * * # Find lexical span * lex_f_i = f_i # <<<<<<<<<<<<<< @@ -65066,75 +65131,75 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_f_i); __pyx_v_lex_f_i = __pyx_v_f_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2130 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2135 * # Find lexical span * lex_f_i = f_i * lex_f_j = f_i + (len(f_span) - 1) # <<<<<<<<<<<<<< * if nt: * if nt[0][1] == lex_f_i: */ - __pyx_t_4 = PyObject_Length(__pyx_v_f_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_v_f_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Add(__pyx_v_f_i, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_f_i, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_lex_f_j = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2131 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2136 * lex_f_i = f_i * lex_f_j = f_i + (len(f_span) - 1) * if nt: # <<<<<<<<<<<<<< * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 */ - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2132 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2137 * lex_f_j = f_i + (len(f_span) - 1) * if nt: * if nt[0][1] == lex_f_i: # <<<<<<<<<<<<<< * lex_f_i += (nt[0][2] - nt[0][1]) + 1 * if nt[-1][2] == lex_f_j: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __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_RichCompare(__pyx_t_3, __pyx_v_lex_f_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_lex_f_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2133 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2138 * if nt: * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 # <<<<<<<<<<<<<< * if nt[-1][2] == lex_f_j: * lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __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; - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_lex_f_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_lex_f_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_lex_f_i, __pyx_t_1); @@ -65143,49 +65208,49 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2134 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2139 * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 * if nt[-1][2] == lex_f_j: # <<<<<<<<<<<<<< * lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lex_f_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lex_f_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2135 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2140 * lex_f_i += (nt[0][2] - nt[0][1]) + 1 * if nt[-1][2] == lex_f_j: * lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 # <<<<<<<<<<<<<< * * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __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_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __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_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __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_InPlaceSubtract(__pyx_v_lex_f_j, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_lex_f_j, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_lex_f_j, __pyx_t_1); @@ -65197,63 +65262,63 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __pyx_L23:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2138 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2143 * * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) * f = Phrase(f_sym) # <<<<<<<<<<<<<< * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __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 = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f_sym)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f_sym)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f_sym)); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2139 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2144 * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) * f = Phrase(f_sym) * e = Phrase(e_sym) # <<<<<<<<<<<<<< * a = tuple(self.alignment.link(i, j) for i, j in links) * return (f, e, a, lex_f_i, lex_f_j) */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __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 = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_e_sym)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_e_sym)); __Pyx_GIVEREF(((PyObject *)__pyx_v_e_sym)); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_v_e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2140 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<< * return (f, e, a, lex_f_i, lex_f_j) * */ - __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __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[8]; __pyx_lineno = 2140; __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 = 2145; __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*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_v_a = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2141 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2146 * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) * return (f, e, a, lex_f_i, lex_f_j) # <<<<<<<<<<<<<< @@ -65261,7 +65326,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * # Rule string from rule */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); @@ -65349,16 +65414,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fmt_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fmt_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -65373,7 +65438,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.fmt_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -65385,7 +65450,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py } static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2150 * # Rule string from rule * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<< @@ -65411,7 +65476,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_gen __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -65453,13 +65518,13 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_a; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -65467,23 +65532,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -65493,24 +65558,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_packed, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_150), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_150), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment), __pyx_n_s__unlink); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment), __pyx_n_s__unlink); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_packed); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_packed); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_packed); - __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; @@ -65531,7 +65596,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetNone(PyExc_StopIteration); @@ -65551,7 +65616,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2144 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2149 * * # Rule string from rule * def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<< @@ -65584,30 +65649,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2150 * # Rule string from rule * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<< * return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __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 = 2145; __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 = 2150; __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 = 2145; __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[8]; __pyx_lineno = 2150; __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; __pyx_v_a_str = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2146 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2151 * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) * return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) # <<<<<<<<<<<<<< @@ -65615,9 +65680,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st * # Lookup online stats for phrase pair (f, e). Return None if no match. */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_151), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_151), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __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 = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f); @@ -65628,7 +65693,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st __Pyx_INCREF(__pyx_v_a_str); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_a_str); __Pyx_GIVEREF(__pyx_v_a_str); - __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 = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2151; __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; @@ -65668,7 +65733,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__ctx_name,0}; PyObject* values[3] = {0,0,0}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2150 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2155 * # Lookup online stats for phrase pair (f, e). Return None if no match. * # IMPORTANT: use get() to avoid adding items to defaultdict * def online_ctx_lookup(self, f, e, ctx_name=None): # <<<<<<<<<<<<<< @@ -65694,7 +65759,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { @@ -65703,7 +65768,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "online_ctx_lookup") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "online_ctx_lookup") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -65720,7 +65785,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.online_ctx_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -65750,7 +65815,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("online_ctx_lookup", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2151 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2156 * # IMPORTANT: use get() to avoid adding items to defaultdict * def online_ctx_lookup(self, f, e, ctx_name=None): * if self.online: # <<<<<<<<<<<<<< @@ -65760,31 +65825,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __pyx_t_1 = (__pyx_v_self->online != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2152 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2157 * def online_ctx_lookup(self, f, e, ctx_name=None): * if self.online: * stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<< * fcount = stats.phrases_f.get(f, 0) * fsample_count = stats.samples_f.get(f, 0) */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_stats = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2153 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2158 * if self.online: * stats = self.online_stats[ctx_name] * fcount = stats.phrases_f.get(f, 0) # <<<<<<<<<<<<<< * fsample_count = stats.samples_f.get(f, 0) * d = stats.phrases_fe.get(f, None) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __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 = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f); @@ -65792,26 +65857,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_fcount = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2154 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2159 * stats = self.online_stats[ctx_name] * fcount = stats.phrases_f.get(f, 0) * fsample_count = stats.samples_f.get(f, 0) # <<<<<<<<<<<<<< * d = stats.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f); @@ -65819,26 +65884,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_v_fsample_count = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2155 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2160 * fcount = stats.phrases_f.get(f, 0) * fsample_count = stats.samples_f.get(f, 0) * d = stats.phrases_fe.get(f, None) # <<<<<<<<<<<<<< * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f); @@ -65846,25 +65911,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None); __Pyx_GIVEREF(Py_None); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_v_d = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2156 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2161 * fsample_count = stats.samples_f.get(f, 0) * d = stats.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 # <<<<<<<<<<<<<< * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe) * return None */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __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[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_e); @@ -65872,7 +65937,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __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[8]; __pyx_lineno = 2161; __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; @@ -65885,7 +65950,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __pyx_v_paircount = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2157 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2162 * d = stats.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe) # <<<<<<<<<<<<<< @@ -65893,15 +65958,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_152); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_152); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_f); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_f); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_e); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_e); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_fcount); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_fcount); @@ -65921,7 +65986,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; @@ -65932,7 +65997,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2158 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2163 * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe) * return None # <<<<<<<<<<<<<< @@ -66018,36 +66083,36 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ntc)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__syms)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -66070,7 +66135,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_f_phrases.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -66081,7 +66146,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< @@ -66114,33 +66179,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2170 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2175 * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<< * return * # Extend with word */ - if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __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 = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) { - __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_t_5; } else { @@ -66148,7 +66213,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2176 * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: * return # <<<<<<<<<<<<<< @@ -66162,58 +66227,58 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2178 * return * # Extend with word * if wc + ntc < self.max_length: # <<<<<<<<<<<<<< * syms.append(f_words[f_j]) * f = Phrase(syms) */ - __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2174 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179 * # Extend with word * if wc + ntc < self.max_length: * syms.append(f_words[f_j]) # <<<<<<<<<<<<<< * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2175 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2180 * if wc + ntc < self.max_length: * syms.append(f_words[f_j]) * f = Phrase(syms) # <<<<<<<<<<<<<< * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __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 = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_syms); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_syms); __Pyx_GIVEREF(__pyx_v_syms); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2176 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2181 * syms.append(f_words[f_j]) * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) # <<<<<<<<<<<<<< @@ -66224,8 +66289,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_t_1 = __pyx_v_f_j; __Pyx_INCREF(__pyx_v_lex_i); __pyx_t_2 = __pyx_v_lex_i; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); @@ -66242,7 +66307,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_v_new_lex_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2177 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2182 * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) # <<<<<<<<<<<<<< @@ -66253,8 +66318,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_t_1 = __pyx_v_f_j; __Pyx_INCREF(__pyx_v_lex_j); __pyx_t_4 = __pyx_v_lex_j; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); @@ -66271,19 +66336,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_v_new_lex_j = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2178 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2183 * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) * phrases.add((f, new_lex_i, new_lex_j)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) * syms.pop() */ - if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_phrases) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); @@ -66294,53 +66359,53 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __Pyx_INCREF(__pyx_v_new_lex_j); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_new_lex_j); __Pyx_GIVEREF(__pyx_v_new_lex_j); - __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2184 * new_lex_j = max(lex_j, f_j) * phrases.add((f, new_lex_i, new_lex_j)) * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) # <<<<<<<<<<<<<< * syms.pop() * # Extend with existing non-terminal */ - __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_lex_i, __pyx_v_new_lex_j, __pyx_t_2, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_lex_i, __pyx_v_new_lex_j, __pyx_t_2, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2180 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185 * phrases.add((f, new_lex_i, new_lex_j)) * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) * syms.pop() # <<<<<<<<<<<<<< * # Extend with existing non-terminal * if syms and sym_isvar(syms[-1]): */ - __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4; } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2182 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2187 * syms.pop() * # Extend with existing non-terminal * if syms and sym_isvar(syms[-1]): # <<<<<<<<<<<<<< * # Don't re-extract the same phrase * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_9) != 0); } else { @@ -66348,17 +66413,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2184 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2189 * if syms and sym_isvar(syms[-1]): * # Don't re-extract the same phrase * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) # <<<<<<<<<<<<<< * # Extend with new non-terminal * if wc + ntc < self.max_length: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __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; @@ -66366,44 +66431,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2186 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2191 * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) * # Extend with new non-terminal * if wc + ntc < self.max_length: # <<<<<<<<<<<<<< * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): * syms.append(sym_setindex(self.category, ntc + 1)) */ - __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __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[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2187 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2192 * # Extend with new non-terminal * if wc + ntc < self.max_length: * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): # <<<<<<<<<<<<<< * syms.append(sym_setindex(self.category, ntc + 1)) * f = Phrase(syms) */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (!__pyx_t_3); if (!__pyx_t_6) { - __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_9) != 0)); __pyx_t_10 = __pyx_t_5; @@ -66416,67 +66481,67 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2188 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2193 * if wc + ntc < self.max_length: * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): * syms.append(sym_setindex(self.category, ntc + 1)) # <<<<<<<<<<<<<< * f = Phrase(syms) * if wc > 0: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2189 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2194 * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): * syms.append(sym_setindex(self.category, ntc + 1)) * f = Phrase(syms) # <<<<<<<<<<<<<< * if wc > 0: * phrases.add((f, lex_i, lex_j)) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __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 = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_syms); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_syms); __Pyx_GIVEREF(__pyx_v_syms); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_f, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_4)); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2190 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2195 * syms.append(sym_setindex(self.category, ntc + 1)) * f = Phrase(syms) * if wc > 0: # <<<<<<<<<<<<<< * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2191 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2196 * f = Phrase(syms) * if wc > 0: * phrases.add((f, lex_i, lex_j)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) * syms.pop() */ - if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_phrases) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_f)); @@ -66487,38 +66552,38 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __Pyx_INCREF(__pyx_v_lex_j); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_lex_j); __Pyx_GIVEREF(__pyx_v_lex_j); - __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; goto __pyx_L8; } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2192 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2197 * if wc > 0: * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) # <<<<<<<<<<<<<< * syms.pop() * */ - __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_t_1, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_t_1, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __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_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2193 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2198 * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) * syms.pop() # <<<<<<<<<<<<<< * * # Try to extract phrases from every f index */ - __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L7; @@ -66546,7 +66611,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2163 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168 * # (Used for EGivenFCoherent) * # Return set of (fphrase, lex_i, lex_j) * def get_f_phrases(self, f_words): # <<<<<<<<<<<<<< @@ -66583,7 +66648,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2165 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2170 * def get_f_phrases(self, f_words): * * f_len = len(f_words) # <<<<<<<<<<<<<< @@ -66592,66 +66657,66 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_f_words; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2165; __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[8]; __pyx_lineno = 2170; __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[8]; __pyx_lineno = 2165; __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[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_f_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2166 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171 * * f_len = len(f_words) * phrases = set() # (fphrase, lex_i, lex_j) # <<<<<<<<<<<<<< * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_cur_scope->__pyx_v_phrases = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, __pyx_n_s_155, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_154)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, __pyx_n_s_155, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_154)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2196 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2201 * * # Try to extract phrases from every f index * for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<< * extract(f_i, f_i, f_len, -1, 0, 0, []) * */ - __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_3; __pyx_v_f_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2197 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2202 * # Try to extract phrases from every f index * for f_i from 0 <= f_i < f_len: * extract(f_i, f_i, f_len, -1, 0, 0, []) # <<<<<<<<<<<<<< * * return phrases */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_v_f_len; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -66660,7 +66725,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2199 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2204 * extract(f_i, f_i, f_len, -1, 0, 0, []) * * return phrases # <<<<<<<<<<<<<< @@ -66703,7 +66768,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ctx_name,0}; PyObject* values[1] = {0}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2202 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2207 * * # Drop online stats for a context * def drop_ctx(self, ctx_name=None): # <<<<<<<<<<<<<< @@ -66728,7 +66793,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drop_ctx") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drop_ctx") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -66741,7 +66806,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("drop_ctx", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("drop_ctx", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.drop_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -66763,16 +66828,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("drop_ctx", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2203 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2208 * # Drop online stats for a context * def drop_ctx(self, ctx_name=None): * self.online_stats.pop(ctx_name, None) # <<<<<<<<<<<<<< * * # Spans are _inclusive_ on both ends [i, j] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->online_stats, __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->online_stats, __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __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 = 2203; __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 = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ctx_name); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ctx_name); @@ -66780,7 +66845,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); __Pyx_GIVEREF(Py_None); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2203; __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[8]; __pyx_lineno = 2208; __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; @@ -66834,16 +66899,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_check") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_check") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -66858,7 +66923,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.span_check", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -66869,7 +66934,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2206 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2211 * * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): # <<<<<<<<<<<<<< @@ -66888,7 +66953,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_check", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2207 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2212 * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -66898,7 +66963,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2208 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2213 * def span_check(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -66906,25 +66971,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ * return False */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __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[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __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[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2209 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2214 * k = i * while k <= j: * if vec[k]: # <<<<<<<<<<<<<< * return False * k += 1 */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_vec, __pyx_v_k); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_vec, __pyx_v_k); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __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[8]; __pyx_lineno = 2209; __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[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2210 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2215 * while k <= j: * if vec[k]: * return False # <<<<<<<<<<<<<< @@ -66932,7 +66997,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ * return True */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -66941,20 +67006,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2211 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2216 * if vec[k]: * return False * k += 1 # <<<<<<<<<<<<<< * return True * */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2212 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2217 * return False * k += 1 * return True # <<<<<<<<<<<<<< @@ -66962,7 +67027,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ * def span_inc(vec, i, j): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -67015,16 +67080,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_inc") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_inc") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -67039,7 +67104,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.span_inc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -67050,7 +67115,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2214 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2219 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< @@ -67071,7 +67136,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_inc", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2215 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2220 * * def span_inc(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -67081,7 +67146,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2216 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2221 * def span_inc(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -67089,12 +67154,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py * k += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2216; __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[8]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2221; __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[8]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2217 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2222 * k = i * while k <= j: * vec[k] += 1 # <<<<<<<<<<<<<< @@ -67103,23 +67168,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py */ __Pyx_INCREF(__pyx_v_k); __pyx_t_1 = __pyx_v_k; - __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2218 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2223 * while k <= j: * vec[k] += 1 * k += 1 # <<<<<<<<<<<<<< * * def span_dec(vec, i, j): */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; @@ -67174,16 +67239,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_dec") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_dec") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -67198,7 +67263,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.span_dec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -67209,7 +67274,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2220 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2225 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< @@ -67230,7 +67295,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_dec", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2221 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2226 * * def span_dec(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -67240,7 +67305,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2222 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2227 * def span_dec(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -67248,12 +67313,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py * k += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __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[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2227; __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[8]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2223 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2228 * k = i * while k <= j: * vec[k] -= 1 # <<<<<<<<<<<<<< @@ -67261,21 +67326,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py */ __Pyx_INCREF(__pyx_v_k); __pyx_t_1 = __pyx_v_k; - __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2224 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2229 * while k <= j: * vec[k] -= 1 * k += 1 # <<<<<<<<<<<<<< */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; @@ -76980,39 +77045,39 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_k_slice_146); __Pyx_GIVEREF(__pyx_k_slice_146); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2083 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2088 * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) # <<<<<<<<<<<<<< * off = f_i * for next_nt in nt: */ - __pyx_k_slice_148 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_slice_148 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_slice_148); __Pyx_GIVEREF(__pyx_k_slice_148); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2093 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2098 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) * e_sym = list(e_span[:]) # <<<<<<<<<<<<<< * off = e_i * for next_nt in nt_inv: */ - __pyx_k_slice_149 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_slice_149 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_slice_149); __Pyx_GIVEREF(__pyx_k_slice_149); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: */ - __pyx_k_tuple_153 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__lex_i), ((PyObject *)__pyx_n_s__lex_j), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__ntc), ((PyObject *)__pyx_n_s__syms), ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__new_lex_i), ((PyObject *)__pyx_n_s__new_lex_j)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_153 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__lex_i), ((PyObject *)__pyx_n_s__lex_j), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__ntc), ((PyObject *)__pyx_n_s__syms), ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__new_lex_i), ((PyObject *)__pyx_n_s__new_lex_j)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_153); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153)); - __pyx_k_codeobj_154 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 2168, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_154 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 2173, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "cdec/sa/_sa.pyx":5 * import gzip @@ -77117,41 +77182,41 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_174)); __pyx_k_codeobj_175 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_165, __pyx_n_s__decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_175)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2206 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2211 * * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_177 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_177 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_177); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_177)); - __pyx_k_codeobj_178 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_check, 2206, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_178 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_check, 2211, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2214 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2219 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_179 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_179 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_179); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_179)); - __pyx_k_codeobj_180 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_inc, 2214, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_180)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_180 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_inc, 2219, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_180)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2220 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2225 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_181 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_181)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_181 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_181)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_181); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_181)); - __pyx_k_codeobj_182 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_dec, 2220, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_182)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_182 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_dec, 2225, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_182)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -77278,7 +77343,7 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_ptype_4cdec_2sa_3_sa_SuffixArray = &__pyx_type_4cdec_2sa_3_sa_SuffixArray; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule; if (PyType_Ready(&__pyx_type_4cdec_2sa_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_4cdec_2sa_3_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -77316,7 +77381,7 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases; __pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode.tp_base = __pyx_ptype_4cdec_2sa_3_sa_TrieNode; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -77334,7 +77399,7 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_input = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "Rule", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -77390,13 +77455,13 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_ptype_4cdec_2sa_3_sa_TrieTable = &__pyx_type_4cdec_2sa_3_sa_TrieTable; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr; @@ -77964,40 +78029,40 @@ PyMODINIT_FUNC PyInit__sa(void) __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2206 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2211 * * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_17span_check, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_17span_check, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_check, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_check, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2214 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2219 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_19span_inc, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_19span_inc, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_inc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_inc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2220 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2225 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_21span_dec, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_21span_dec, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_dec, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_dec, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":1 diff --git a/python/cdec/sa/compile.py b/python/cdec/sa/compile.py index caa93f8b..3cdf212f 100644 --- a/python/cdec/sa/compile.py +++ b/python/cdec/sa/compile.py @@ -54,6 +54,8 @@ def main(): help='Bitext word alignment') parser.add_argument('-o', '--output', required=True, help='Output path') + parser.add_argument('--online', action='store_true', + help='Compile data for online grammar extraction') args = parser.parse_args() if not ((args.source and args.target) or args.bitext): @@ -74,6 +76,8 @@ def main(): precomp_bin = os.path.join(args.output, precomp_file) a_bin = os.path.join(args.output, 'a.bin') lex_bin = os.path.join(args.output, 'lex.bin') + # online only + bilex_file = os.path.join(args.output, 'bilex.gz') config = cdec.configobj.ConfigObj(args.config, unrepr=True) config['f_sa_file'] = os.path.abspath(f_sa_bin) @@ -81,6 +85,8 @@ def main(): config['a_file'] = os.path.abspath(a_bin) config['lex_file'] = os.path.abspath(lex_bin) config['precompute_file'] = os.path.abspath(precomp_bin) + if args.online: + config['bilex_file'] = os.path.abspath(bilex_file) start_time = monitor_cpu() logger.info('Compiling source suffix array') @@ -122,6 +128,17 @@ def main(): stop_time = monitor_cpu() logger.info('Compiling bilexical dictionary took %f seconds', stop_time - start_time) + if args.online: + start_time = monitor_cpu() + logger.info('Compiling online bilexical dictionary') + if args.bitext: + bilex = cdec.sa.online.Bilex(alignment_f=args.alignment, text_f=args.bitext) + else: + bilex = cdec.sa.online.Bilex(alignment_f=args.alignment, text_f=args.source, text_target_f=args.target) + bilex.write(bilex_file) + stop_time = monitor_cpu() + logger.info('Compiling online bilexical dictionary took %f seconds', stop_time - start_time) + # Write configuration for name, value in zip(param_names, params): config[name] = value diff --git a/python/cdec/sa/extract.py b/python/cdec/sa/extract.py index d8f14b11..b6502c52 100644 --- a/python/cdec/sa/extract.py +++ b/python/cdec/sa/extract.py @@ -12,13 +12,12 @@ from cdec.sa._sa import monitor_cpu extractor, prefix = None, None online, compress = False, False -vocab = None def make_extractor(args): global extractor, prefix, online, compress signal.signal(signal.SIGINT, signal.SIG_IGN) # Let parent process catch Ctrl+C load_features(args.features) - extractor = cdec.sa.GrammarExtractor(args.config, online, vocab) + extractor = cdec.sa.GrammarExtractor(args.config, online) prefix = args.grammars online = args.online compress = args.compress @@ -64,7 +63,7 @@ def extract(inp): return '{}{}'.format(grammar_file, i, sentence, suffix) def main(): - global online, vocab + global online logging.basicConfig(level=logging.INFO) parser = argparse.ArgumentParser(description='Extract grammars from a compiled corpus.') parser.add_argument('-c', '--config', required=True, @@ -79,8 +78,6 @@ def main(): help='additional feature definitions') parser.add_argument('-o', '--online', action='store_true', help='online grammar extraction') - parser.add_argument('-e', '--except-vocab', default=None, - help='add LM and Lex except features (use with -o, pass vocab.gz)') parser.add_argument('-z', '--compress', action='store_true', help='compress grammars with gzip') args = parser.parse_args() @@ -94,7 +91,6 @@ def main(): sys.exit(1) online = args.online - vocab = args.except_vocab start_time = monitor_cpu() if args.jobs > 1: diff --git a/python/cdec/sa/extractor.py b/python/cdec/sa/extractor.py index 244f84be..25313cc3 100644 --- a/python/cdec/sa/extractor.py +++ b/python/cdec/sa/extractor.py @@ -4,14 +4,14 @@ import cdec.configobj from cdec.sa._sa import gzip_or_text from cdec.sa.features import EgivenFCoherent, SampleCountF, CountEF,\ MaxLexEgivenF, MaxLexFgivenE, IsSingletonF, IsSingletonFE,\ - IsSupportedOnline, CountExceptLM, CountExceptLex + IsSupportedOnline, CountExceptLM import cdec.sa # maximum span of a grammar rule in TEST DATA MAX_INITIAL_SIZE = 15 class GrammarExtractor: - def __init__(self, config, online=False, vocab=None, features=None): + def __init__(self, config, online=False, features=None): if isinstance(config, basestring): if not os.path.exists(config): raise IOError('cannot read configuration from {0}'.format(config)) @@ -60,13 +60,13 @@ class GrammarExtractor: tt = cdec.sa.BiLex(from_binary=config['lex_file']) # TODO: clean this up + # Load data and add features for online grammar extraction extended_features = [] if online: extended_features.append(IsSupportedOnline) - if vocab: + vocab_file = config['vocab_file'] vcb_set = set(line.strip() for line in gzip_or_text(vocab)) extended_features.append(CountExceptLM(vcb_set)) - extended_features.append(CountExceptLex(tt)) # TODO: use @cdec.sa.features decorator for standard features too # + add a mask to disable features diff --git a/python/cdec/sa/features.py b/python/cdec/sa/features.py index dcc60401..3e6af859 100644 --- a/python/cdec/sa/features.py +++ b/python/cdec/sa/features.py @@ -145,9 +145,3 @@ def CountExceptLM(vocab): def CountExceptLM(ctx): # Word count in bitext (inc online data) but NOT mono text return sum(1 for e in ctx.ephrase.words if e not in vocab) return CountExceptLM - -def CountExceptLex(ttable): - def CountExceptLex(ctx): # Word count in online data but NOT aligned in original bitext - # TODO: Check that online data actually contains aligned word when rulefactory TODO is addressed. - return sum(1 for e in ctx.ephrase.words if not ttable.contains_e_word(e)) - return CountExceptLex diff --git a/python/cdec/sa/online.py b/python/cdec/sa/online.py new file mode 100644 index 00000000..92f6eae2 --- /dev/null +++ b/python/cdec/sa/online.py @@ -0,0 +1,95 @@ +from __future__ import division + +import collections +import gzip +import itertools + +from cdec.sa._sa import gzip_or_text + +# Same as Cython implementation. Collisions with NULL in bitext? +NULL_WORD = 'NULL' + +def learn_vocab(text_f): + vocab = set() + for line in gzip_or_text(text_f): + for word in line.strip().split(): + vocab.add(word) + return vocab + +def write_vocab(vocab, out_f): + with gzip.open(out_f, 'wb') as out: + for word in sorted(vocab): + out.write('{}\n'.format(word)) + +def read_vocab(in_f): + return set(line.strip() for line in gzip_or_text(in_f)) + +class Bilex: + + def __init__(self, in_f=None, alignment_f=None, text_f=None, target_text_f=None): + self.f = collections.defaultdict(int) + self.e = collections.defaultdict(int) + self.fe = collections.defaultdict(lambda: collections.defaultdict(int)) + self.ef = collections.defaultdict(lambda: collections.defaultdict(int)) + + # Read from file + if in_f: + self.read(in_f) + # Build from aligned bitext + elif alignment_f: + # Allow one or two args for bitext + if target_text_f: + t = itertools.izip((line.strip() for line in gzip_or_text(text_f)), (line.strip() for line in gzip_or_text(target_text_f))) + else: + t = (line.strip().split(' ||| ') for line in gzip_or_text(text_f)) + a = (line.strip() for line in gzip_or_text(alignment_f)) + for (source, target) in t: + links = sorted(tuple(int(link) for link in link_str.split('-')) for link_str in a.next().split()) + self.update(source.split(), target.split(), links) + + # Add bilex counts from new aligned sentence pair + def update(self, f_words, e_words, links): + aligned_fe = [list() for _ in range(len(f_words))] + aligned_ef = [list() for _ in range(len(e_words))] + for (i, j) in links: + aligned_fe[i].append(j) + aligned_ef[j].append(i) + for f_i in range(len(f_words)): + self.f[f_words[f_i]] += 1 + e_i_aligned = aligned_fe[f_i] + lc = len(e_i_aligned) + if lc > 0: + for e_i in e_i_aligned: + self.fe[f_words[f_i]][e_words[e_i]] += (1 / lc) + else: + self.fe[f_words[f_i]][NULL_WORD] += 1 + for e_i in range(len(e_words)): + self.e[e_words[e_i]] += 1 + f_i_aligned = aligned_ef[e_i] + lc = len(f_i_aligned) + if lc > 0: + for f_i in f_i_aligned: + self.ef[e_words[e_i]][f_words[f_i]] += (1 / lc) + else: + self.ef[e_words[e_i]][NULL_WORD] += 1 + + def write(self, out_f): + fv = sorted(self.f) + ev = sorted(self.e) + with gzip.open(out_f, 'wb') as out: + for f in fv: + out.write('{} {}\n'.format(f, self.f[f])) + out.write('\n') + for e in ev: + out.write('{} {}\n'.format(e, self.e[e])) + out.write('\n') + for f in fv: + for (e, c) in sorted(self.fe[f].iteritems()): + out.write('{} {} {}\n'.format(f, e, c)) + for e in ev: + for (f, c) in sorted(self.ef[e].iteritems()): + out.write('{} {} {}\n'.format(e, f, c)) + + def read(self, in_f): + with gzip_or_text(in_f) as inp: + pass diff --git a/python/cdec/sa/rulefactory.pxi b/python/cdec/sa/rulefactory.pxi index 044a78c8..86b994b9 100644 --- a/python/cdec/sa/rulefactory.pxi +++ b/python/cdec/sa/rulefactory.pxi @@ -2057,23 +2057,28 @@ cdef class HieroCachingRuleFactory: # Update Bilexical counts aligned_fe = [list() for _ in range(len(f_words))] aligned_ef = [list() for _ in range(len(e_words))] + null_word = sym_fromstring('NULL', True) for (i, j) in alignment: aligned_fe[i].append(j) aligned_ef[j].append(i) for f_i in range(len(f_words)): + stats.bilex_f[f_words[f_i]] += 1 e_i_aligned = aligned_fe[f_i] lc = len(e_i_aligned) if lc > 0: - stats.bilex_f[f_words[f_i]] += 1 for e_i in e_i_aligned: stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc + else: + stats.bilex_fe[f_words[f_i]][null_word] += 1 for e_i in range(len(e_words)): + stats.bilex_e[e_words[e_i]] += 1 f_i_aligned = aligned_ef[e_i] lc = len(f_i_aligned) if lc > 0: - stats.bilex_e[e_words[e_i]] += 1 for f_i in f_i_aligned: stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc + else: + stats.bilex_ef[e_words[e_i]][null_word] += 1 # Create a rule from source, target, non-terminals, and alignments def form_rule(self, f_i, e_i, f_span, e_span, nt, al): -- cgit v1.2.3 From fcf92357806816bb65dade6f761fa08448f88f71 Mon Sep 17 00:00:00 2001 From: Michael Denkowski Date: Fri, 7 Mar 2014 01:52:09 -0800 Subject: More online bilex updates --- python/cdec/sa/_sa.cpp | 9343 +++++++++++++++++----------------------- python/cdec/sa/compile.py | 6 +- python/cdec/sa/extractor.py | 10 +- python/cdec/sa/features.py | 63 +- python/cdec/sa/online.py | 72 +- python/cdec/sa/rulefactory.pxi | 42 +- 6 files changed, 4015 insertions(+), 5521 deletions(-) (limited to 'python/cdec/sa') diff --git a/python/cdec/sa/_sa.cpp b/python/cdec/sa/_sa.cpp index 6e8b0a6f..e19d519c 100644 --- a/python/cdec/sa/_sa.cpp +++ b/python/cdec/sa/_sa.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.19.2 on Thu Mar 6 14:00:22 2014 */ +/* Generated by Cython 0.19.2 on Fri Mar 7 01:47:56 2014 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS @@ -639,7 +639,7 @@ struct __pyx_t_4cdec_2sa_3_sa__Trie_Node { int arr_len; }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":104 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":90 * * # linked list structure for storing matches in BaselineRuleFactory * cdef struct match_node: # <<<<<<<<<<<<<< @@ -651,7 +651,7 @@ struct __pyx_t_4cdec_2sa_3_sa_match_node { struct __pyx_t_4cdec_2sa_3_sa_match_node *next; }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":200 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":186 * * # struct used to encapsulate a single matching * cdef struct Matching: # <<<<<<<<<<<<<< @@ -710,7 +710,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2149 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2109 * * # Rule string from rule * def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<< @@ -755,7 +755,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":40 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":36 * ]) * * cdef class OnlineStats: # <<<<<<<<<<<<<< @@ -769,10 +769,6 @@ struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats { PyObject *phrases_e; PyObject *phrases_fe; PyObject *phrases_al; - PyObject *bilex_f; - PyObject *bilex_e; - PyObject *bilex_fe; - PyObject *bilex_ef; }; @@ -810,7 +806,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Phrase { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":74 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":60 * cdef int EPSILON = sym_fromstring('*EPS*', True) * * cdef class TrieNode: # <<<<<<<<<<<<<< @@ -822,6 +818,14 @@ struct __pyx_obj_4cdec_2sa_3_sa_TrieNode { PyObject *children; }; + +/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":74 + * def read_bitext(self, char* filename, int side): + * with gzip_or_text(filename) as fp: + * data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<< + * self.read_text_data(data) + * + */ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr { PyObject_HEAD struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *__pyx_outer_scope; @@ -863,7 +867,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2128 * # (Used for EGivenFCoherent) * # Return set of (fphrase, lex_i, lex_j) * def get_f_phrases(self, f_words): # <<<<<<<<<<<<<< @@ -880,7 +884,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":80 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":66 * self.children = {} * * cdef class ExtendedTrieNode(TrieNode): # <<<<<<<<<<<<<< @@ -910,7 +914,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Alignment { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":981 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":967 * return sorted(result); * * def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<< @@ -1019,7 +1023,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<< @@ -1054,7 +1058,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Rule { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1196 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1182 * if self.online: * stats = self.online_stats[ctx_name] * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<< @@ -1108,7 +1112,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1894 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1880 * # Aggregate stats from a training instance * # (Extract rules, update counts) * def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<< @@ -1253,7 +1257,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":91 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":77 * * * cdef class TrieTable: # <<<<<<<<<<<<<< @@ -1281,7 +1285,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2150 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110 * # Rule string from rule * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<< @@ -1332,7 +1336,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2084 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2044 * * # Create a rule from source, target, non-terminals, and alignments * def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<< @@ -1391,7 +1395,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":112 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":98 * # in the suffix array; if discontiguous, it is the set of * # actual locations (packed into an array) * cdef class PhraseLocation: # <<<<<<<<<<<<<< @@ -1424,7 +1428,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Scorer { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":134 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":120 * * * cdef class Sampler: # <<<<<<<<<<<<<< @@ -1510,7 +1514,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator { }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":256 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":242 * * * cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<< @@ -1829,7 +1833,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList { static struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *__pyx_vtabptr_4cdec_2sa_3_sa_FloatList; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":256 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":242 * * * cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<< @@ -1888,7 +1892,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase { static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *__pyx_vtabptr_4cdec_2sa_3_sa_Phrase; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":112 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":98 * # in the suffix array; if discontiguous, it is the set of * # actual locations (packed into an array) * cdef class PhraseLocation: # <<<<<<<<<<<<<< @@ -2761,8 +2765,6 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ @@ -2779,18 +2781,6 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_4__del__(struct __ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children___get__(struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *__pyx_v_self); /* proto */ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ @@ -2827,15 +2817,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_dist); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_ito); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_states(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v__columns, PyObject *__pyx_v_curr_idx, PyObject *__pyx_v_min_dist); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_meta, PyObject *__pyx_v_ctx_name); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(PyObject *__pyx_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_f_j, PyObject *__pyx_v_e_i, PyObject *__pyx_v_e_j, PyObject *__pyx_v_min_bound, PyObject *__pyx_v_wc, PyObject *__pyx_v_links, PyObject *__pyx_v_nt, PyObject *__pyx_v_nt_open); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instance(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_words, PyObject *__pyx_v_e_words, PyObject *__pyx_v_alignment, PyObject *__pyx_v_ctx_name); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_e_i, PyObject *__pyx_v_f_span, PyObject *__pyx_v_e_span, PyObject *__pyx_v_nt, PyObject *__pyx_v_al); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(PyObject *__pyx_self); /* proto */ @@ -2996,7 +2986,7 @@ static char __pyx_k_120[] = "{"; static char __pyx_k_122[] = "}"; static char __pyx_k_123[] = "get_precomputed_collocation"; static char __pyx_k_124[] = "double binary"; -static char __pyx_k_125[] = "HieroCachingRuleFactory.input..lambda5.."; +static char __pyx_k_125[] = "HieroCachingRuleFactory.input..lambda3.."; static char __pyx_k_126[] = "Keyword trie error"; static char __pyx_k_128[] = "HieroCachingRuleFactory.input.."; static char __pyx_k_129[] = "get_all_nodes_isteps_away"; @@ -3127,8 +3117,6 @@ static char __pyx_k__unlink[] = "unlink"; static char __pyx_k__Counter[] = "Counter"; static char __pyx_k__advance[] = "advance"; static char __pyx_k__arr_low[] = "arr_low"; -static char __pyx_k__bilex_e[] = "bilex_e"; -static char __pyx_k__bilex_f[] = "bilex_f"; static char __pyx_k__collect[] = "collect"; static char __pyx_k__e_words[] = "e_words"; static char __pyx_k__edarray[] = "edarray"; @@ -3155,8 +3143,6 @@ static char __pyx_k____name__[] = "__name__"; static char __pyx_k____test__[] = "__test__"; static char __pyx_k___columns[] = "_columns"; static char __pyx_k__arr_high[] = "arr_high"; -static char __pyx_k__bilex_ef[] = "bilex_ef"; -static char __pyx_k__bilex_fe[] = "bilex_fe"; static char __pyx_k__category[] = "category"; static char __pyx_k__children[] = "children"; static char __pyx_k__ctx_name[] = "ctx_name"; @@ -3409,10 +3395,6 @@ static PyObject *__pyx_n_s__arity; static PyObject *__pyx_n_s__arr; static PyObject *__pyx_n_s__arr_high; static PyObject *__pyx_n_s__arr_low; -static PyObject *__pyx_n_s__bilex_e; -static PyObject *__pyx_n_s__bilex_ef; -static PyObject *__pyx_n_s__bilex_f; -static PyObject *__pyx_n_s__bilex_fe; static PyObject *__pyx_n_s__by_slack_factor; static PyObject *__pyx_n_s__category; static PyObject *__pyx_n_s__chain; @@ -37282,7 +37264,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1(PyObje return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":58 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":50 * self.phrases_f = defaultdict(int) * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< @@ -37301,14 +37283,14 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda1", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __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 = 58; __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 = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; __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[8]; __pyx_lineno = 50; __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; @@ -37342,12 +37324,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2(PyObj return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":59 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":51 * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<< * - * # Bilexical counts + * cdef int PRECOMPUTE = 0 */ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self) { @@ -37361,14 +37343,14 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda2", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __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 = 59; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyTuple_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyTuple_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyTuple_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 59; __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[8]; __pyx_lineno = 51; __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; @@ -37390,128 +37372,8 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* Python wrapper */ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___2lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___2lambda3 = {__Pyx_NAMESTR("lambda3"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___2lambda3, METH_NOARGS, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___2lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0); - __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":64 - * self.bilex_f = defaultdict(int) - * self.bilex_e = defaultdict(int) - * self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< - * self.bilex_ef = defaultdict(lambda: defaultdict(int)) - * - */ - -static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda3", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __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; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 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_3); - __Pyx_AddTraceback("cdec.sa._sa.OnlineStats.__cinit__.lambda3", __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_4cdec_2sa_3_sa_11OnlineStats_9__cinit___3lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___3lambda4 = {__Pyx_NAMESTR("lambda4"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___3lambda4, METH_NOARGS, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___3lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0); - __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":65 - * self.bilex_e = defaultdict(int) - * self.bilex_fe = defaultdict(lambda: defaultdict(int)) - * self.bilex_ef = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< - * - * cdef int PRECOMPUTE = 0 - */ - -static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda4", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __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 = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __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; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 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_3); - __Pyx_AddTraceback("cdec.sa._sa.OnlineStats.__cinit__.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":51 - * cdef public bilex_ef +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":43 + * cdef public phrases_al * * def __cinit__(self): # <<<<<<<<<<<<<< * # Keep track of everything that can be sampled: @@ -37529,21 +37391,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":53 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":45 * def __cinit__(self): * # Keep track of everything that can be sampled: * self.samples_f = defaultdict(int) # <<<<<<<<<<<<<< * * # Phrase counts */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 45; __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 = 53; __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 = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 53; __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[8]; __pyx_lineno = 45; __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; @@ -37553,21 +37415,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde __pyx_v_self->samples_f = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":56 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":48 * * # Phrase counts * self.phrases_f = defaultdict(int) # <<<<<<<<<<<<<< * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __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 = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; @@ -37577,21 +37439,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde __pyx_v_self->phrases_f = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":57 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":49 * # Phrase counts * self.phrases_f = defaultdict(int) * self.phrases_e = defaultdict(int) # <<<<<<<<<<<<<< * self.phrases_fe = defaultdict(lambda: defaultdict(int)) * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 49; __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 = 57; __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 = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; __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[8]; __pyx_lineno = 49; __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; @@ -37601,23 +37463,23 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde __pyx_v_self->phrases_e = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":58 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":50 * self.phrases_f = defaultdict(int) * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __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 = 58; __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 = 50; __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_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __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_1)); __pyx_t_1 = 0; @@ -37627,23 +37489,23 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde __pyx_v_self->phrases_fe = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":59 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":51 * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<< * - * # Bilexical counts + * cdef int PRECOMPUTE = 0 */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __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[8]; __pyx_lineno = 59; __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 = 51; __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 = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 51; __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; @@ -37653,106 +37515,6 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde __pyx_v_self->phrases_al = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":62 - * - * # Bilexical counts - * self.bilex_f = defaultdict(int) # <<<<<<<<<<<<<< - * self.bilex_e = defaultdict(int) - * self.bilex_fe = defaultdict(lambda: defaultdict(int)) - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 62; __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[8]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __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 = 62; __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; - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_self->bilex_f); - __Pyx_DECREF(__pyx_v_self->bilex_f); - __pyx_v_self->bilex_f = __pyx_t_2; - __pyx_t_2 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":63 - * # Bilexical counts - * self.bilex_f = defaultdict(int) - * self.bilex_e = defaultdict(int) # <<<<<<<<<<<<<< - * self.bilex_fe = defaultdict(lambda: defaultdict(int)) - * self.bilex_ef = defaultdict(lambda: defaultdict(int)) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 63; __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 = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __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 = 63; __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_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_self->bilex_e); - __Pyx_DECREF(__pyx_v_self->bilex_e); - __pyx_v_self->bilex_e = __pyx_t_1; - __pyx_t_1 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":64 - * self.bilex_f = defaultdict(int) - * self.bilex_e = defaultdict(int) - * self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< - * self.bilex_ef = defaultdict(lambda: defaultdict(int)) - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___2lambda3, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __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; - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_v_self->bilex_fe); - __Pyx_DECREF(__pyx_v_self->bilex_fe); - __pyx_v_self->bilex_fe = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":65 - * self.bilex_e = defaultdict(int) - * self.bilex_fe = defaultdict(lambda: defaultdict(int)) - * self.bilex_ef = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< - * - * cdef int PRECOMPUTE = 0 - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___3lambda4, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __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 = 65; __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_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __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_1)); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_self->bilex_ef); - __Pyx_DECREF(__pyx_v_self->bilex_ef); - __pyx_v_self->bilex_ef = __pyx_t_2; - __pyx_t_2 = 0; - __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -37777,7 +37539,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_1__get__(PyObj return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":41 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":37 * * cdef class OnlineStats: * cdef public samples_f # <<<<<<<<<<<<<< @@ -37864,7 +37626,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_1__get__(PyObj return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":42 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":38 * cdef class OnlineStats: * cdef public samples_f * cdef public phrases_f # <<<<<<<<<<<<<< @@ -37951,7 +37713,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_1__get__(PyObj return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":43 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":39 * cdef public samples_f * cdef public phrases_f * cdef public phrases_e # <<<<<<<<<<<<<< @@ -38038,12 +37800,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_1__get__(PyO return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":44 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":40 * cdef public phrases_f * cdef public phrases_e * cdef public phrases_fe # <<<<<<<<<<<<<< * cdef public phrases_al - * cdef public bilex_f + * */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { @@ -38125,12 +37887,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_1__get__(PyO return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":45 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":41 * cdef public phrases_e * cdef public phrases_fe * cdef public phrases_al # <<<<<<<<<<<<<< - * cdef public bilex_f - * cdef public bilex_e + * + * def __cinit__(self): */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { @@ -38201,354 +37963,6 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_4__del__(struct __ return __pyx_r; } -/* Python wrapper */ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":46 - * cdef public phrases_fe - * cdef public phrases_al - * cdef public bilex_f # <<<<<<<<<<<<<< - * cdef public bilex_e - * cdef public bilex_fe - */ - -static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->bilex_f); - __pyx_r = __pyx_v_self->bilex_f; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->bilex_f); - __Pyx_DECREF(__pyx_v_self->bilex_f); - __pyx_v_self->bilex_f = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->bilex_f); - __Pyx_DECREF(__pyx_v_self->bilex_f); - __pyx_v_self->bilex_f = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":47 - * cdef public phrases_al - * cdef public bilex_f - * cdef public bilex_e # <<<<<<<<<<<<<< - * cdef public bilex_fe - * cdef public bilex_ef - */ - -static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->bilex_e); - __pyx_r = __pyx_v_self->bilex_e; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->bilex_e); - __Pyx_DECREF(__pyx_v_self->bilex_e); - __pyx_v_self->bilex_e = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->bilex_e); - __Pyx_DECREF(__pyx_v_self->bilex_e); - __pyx_v_self->bilex_e = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":48 - * cdef public bilex_f - * cdef public bilex_e - * cdef public bilex_fe # <<<<<<<<<<<<<< - * cdef public bilex_ef - * - */ - -static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->bilex_fe); - __pyx_r = __pyx_v_self->bilex_fe; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->bilex_fe); - __Pyx_DECREF(__pyx_v_self->bilex_fe); - __pyx_v_self->bilex_fe = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->bilex_fe); - __Pyx_DECREF(__pyx_v_self->bilex_fe); - __pyx_v_self->bilex_fe = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":49 - * cdef public bilex_e - * cdef public bilex_fe - * cdef public bilex_ef # <<<<<<<<<<<<<< - * - * def __cinit__(self): - */ - -static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->bilex_ef); - __pyx_r = __pyx_v_self->bilex_ef; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->bilex_ef); - __Pyx_DECREF(__pyx_v_self->bilex_ef); - __pyx_v_self->bilex_ef = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->bilex_ef); - __Pyx_DECREF(__pyx_v_self->bilex_ef); - __pyx_v_self->bilex_ef = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -38563,7 +37977,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":77 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":63 * cdef public children * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -38580,14 +37994,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":78 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":64 * * def __cinit__(self): * self.children = {} # <<<<<<<<<<<<<< * * cdef class ExtendedTrieNode(TrieNode): */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __Pyx_GOTREF(__pyx_v_self->children); @@ -38617,7 +38031,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_1__get__(PyObject * return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":75 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":61 * * cdef class TrieNode: * cdef public children # <<<<<<<<<<<<<< @@ -38709,7 +38123,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx 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}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":85 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":71 * cdef public suffix_link * * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<< @@ -38748,7 +38162,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx } } 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 = 85; __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[8]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -38765,7 +38179,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.ExtendedTrieNode.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -38781,7 +38195,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":86 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":72 * * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): * self.phrase = phrase # <<<<<<<<<<<<<< @@ -38794,7 +38208,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->phrase); __pyx_v_self->phrase = __pyx_v_phrase; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":87 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":73 * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): * self.phrase = phrase * self.phrase_location = phrase_location # <<<<<<<<<<<<<< @@ -38807,7 +38221,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->phrase_location); __pyx_v_self->phrase_location = __pyx_v_phrase_location; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":88 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":74 * self.phrase = phrase * self.phrase_location = phrase_location * self.suffix_link = suffix_link # <<<<<<<<<<<<<< @@ -38836,7 +38250,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyO return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":81 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":67 * * cdef class ExtendedTrieNode(TrieNode): * cdef public phrase # <<<<<<<<<<<<<< @@ -38923,7 +38337,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_1_ return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":82 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":68 * cdef class ExtendedTrieNode(TrieNode): * cdef public phrase * cdef public phrase_location # <<<<<<<<<<<<<< @@ -39010,7 +38424,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_1__get return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":83 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":69 * cdef public phrase * cdef public phrase_location * cdef public suffix_link # <<<<<<<<<<<<<< @@ -39117,7 +38531,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_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 = 95; __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[8]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -39130,7 +38544,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.TrieTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -39141,7 +38555,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":95 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":81 * cdef public int count * cdef public root * def __cinit__(self, extended=False): # <<<<<<<<<<<<<< @@ -39160,7 +38574,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":96 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":82 * cdef public root * def __cinit__(self, extended=False): * self.count = 0 # <<<<<<<<<<<<<< @@ -39169,34 +38583,34 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2 */ __pyx_v_self->count = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":97 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":83 * def __cinit__(self, extended=False): * self.count = 0 * self.extended = extended # <<<<<<<<<<<<<< * if extended: * self.root = ExtendedTrieNode() */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_extended); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_extended); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->extended = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":98 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":84 * self.count = 0 * self.extended = extended * if extended: # <<<<<<<<<<<<<< * self.root = ExtendedTrieNode() * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":99 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":85 * self.extended = extended * if extended: * self.root = ExtendedTrieNode() # <<<<<<<<<<<<<< * else: * self.root = TrieNode() */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root); @@ -39207,14 +38621,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2 } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":101 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":87 * self.root = ExtendedTrieNode() * else: * self.root = TrieNode() # <<<<<<<<<<<<<< * * # linked list structure for storing matches in BaselineRuleFactory */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root); @@ -39246,7 +38660,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_8extended_1__get__(PyObject return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":92 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":78 * * cdef class TrieTable: * cdef public int extended # <<<<<<<<<<<<<< @@ -39263,7 +38677,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->extended); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_self->extended); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -39300,7 +38714,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended_2__set__(struct __pyx_ob 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[8]; __pyx_lineno = 92; __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[8]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->extended = __pyx_t_1; __pyx_r = 0; @@ -39324,7 +38738,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_5count_1__get__(PyObject *__ return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":93 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":79 * cdef class TrieTable: * cdef public int extended * cdef public int count # <<<<<<<<<<<<<< @@ -39341,7 +38755,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count___get__(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -39378,7 +38792,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count_2__set__(struct __pyx_obj_4 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[8]; __pyx_lineno = 93; __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[8]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->count = __pyx_t_1; __pyx_r = 0; @@ -39402,7 +38816,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_1__get__(PyObject *__p return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":94 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":80 * cdef public int extended * cdef public int count * cdef public root # <<<<<<<<<<<<<< @@ -39478,7 +38892,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_4c return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":121 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":107 * * # returns true if sent_id is contained * cdef int contains(self, int sent_id): # <<<<<<<<<<<<<< @@ -39491,7 +38905,7 @@ static int __pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":122 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":108 * # returns true if sent_id is contained * cdef int contains(self, int sent_id): * return 1 # <<<<<<<<<<<<<< @@ -39526,7 +38940,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v 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}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":125 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":111 * * def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, * arr=None, int num_subpatterns=1): # <<<<<<<<<<<<<< @@ -39581,7 +38995,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v } } 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 = 124; __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[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -39596,35 +39010,35 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v } } if (values[0]) { - __pyx_v_sa_low = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_sa_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sa_low = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_sa_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_sa_low = ((int)-1); } if (values[1]) { - __pyx_v_sa_high = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_sa_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sa_high = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_sa_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_sa_high = ((int)-1); } if (values[2]) { - __pyx_v_arr_low = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_arr_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_arr_low = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_arr_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_arr_low = ((int)-1); } if (values[3]) { - __pyx_v_arr_high = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_arr_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_arr_high = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_arr_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_arr_high = ((int)-1); } __pyx_v_arr = values[4]; if (values[5]) { - __pyx_v_num_subpatterns = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_num_subpatterns == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_num_subpatterns = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_num_subpatterns == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_num_subpatterns = ((int)1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.PhraseLocation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -39635,7 +39049,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":124 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":110 * return 1 * * def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<< @@ -39651,7 +39065,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":126 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":112 * def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, * arr=None, int num_subpatterns=1): * self.sa_low = sa_low # <<<<<<<<<<<<<< @@ -39660,7 +39074,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 */ __pyx_v_self->sa_low = __pyx_v_sa_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":127 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":113 * arr=None, int num_subpatterns=1): * self.sa_low = sa_low * self.sa_high = sa_high # <<<<<<<<<<<<<< @@ -39669,7 +39083,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 */ __pyx_v_self->sa_high = __pyx_v_sa_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":128 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":114 * self.sa_low = sa_low * self.sa_high = sa_high * self.arr_low = arr_low # <<<<<<<<<<<<<< @@ -39678,7 +39092,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 */ __pyx_v_self->arr_low = __pyx_v_arr_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":129 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":115 * self.sa_high = sa_high * self.arr_low = arr_low * self.arr_high = arr_high # <<<<<<<<<<<<<< @@ -39687,21 +39101,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 */ __pyx_v_self->arr_high = __pyx_v_arr_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":130 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":116 * self.arr_low = arr_low * self.arr_high = arr_high * self.arr = arr # <<<<<<<<<<<<<< * self.num_subpatterns = num_subpatterns * */ - if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 116; __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_4cdec_2sa_3_sa_IntList *)__pyx_v_arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":131 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":117 * self.arr_high = arr_high * self.arr = arr * self.num_subpatterns = num_subpatterns # <<<<<<<<<<<<<< @@ -39751,11 +39165,11 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P case 1: 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 = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } 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 = 141; __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[8]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -39763,18 +39177,18 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P values[0] = PyTuple_GET_ITEM(__pyx_args, 0); 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 = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_fsarray = ((struct __pyx_obj_4cdec_2sa_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 = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._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_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)__pyx_v_self), __pyx_v_sample_size, __pyx_v_fsarray); goto __pyx_L0; __pyx_L1_error:; @@ -39784,7 +39198,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":141 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":127 * cdef IntList sa * * def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<< @@ -39804,7 +39218,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":142 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":128 * * def __cinit__(self, int sample_size, SuffixArray fsarray): * self.sample_size = sample_size # <<<<<<<<<<<<<< @@ -39813,7 +39227,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa */ __pyx_v_self->sample_size = __pyx_v_sample_size; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":143 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":129 * def __cinit__(self, int sample_size, SuffixArray fsarray): * self.sample_size = sample_size * self.sa = fsarray.sa # <<<<<<<<<<<<<< @@ -39828,7 +39242,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa __pyx_v_self->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":144 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":130 * self.sample_size = sample_size * self.sa = fsarray.sa * if sample_size > 0: # <<<<<<<<<<<<<< @@ -39838,21 +39252,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa __pyx_t_2 = ((__pyx_v_sample_size > 0) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":145 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":131 * self.sa = fsarray.sa * if sample_size > 0: * logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) # <<<<<<<<<<<<<< * else: * logger.info("Sampling strategy: no sampling") */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_sample_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_sample_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_s_104)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_104)); @@ -39860,7 +39274,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; @@ -39869,19 +39283,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":147 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":133 * logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) * else: * logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<< * * def sample(self, PhraseLocation phrase_location): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -39911,7 +39325,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7Sampler_3sample(PyObject *__pyx_v_self PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sample (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)__pyx_v_self), ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_v_phrase_location)); goto __pyx_L0; __pyx_L1_error:; @@ -39921,7 +39335,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7Sampler_3sample(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":149 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":135 * logger.info("Sampling strategy: no sampling") * * def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<< @@ -39948,19 +39362,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sample", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":162 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":148 * cdef int num_locations, val, j * * sample = IntList() # <<<<<<<<<<<<<< * 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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_sample = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":163 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":149 * * sample = IntList() * if phrase_location.arr is None: # <<<<<<<<<<<<<< @@ -39971,7 +39385,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":164 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":150 * sample = IntList() * if phrase_location.arr is None: * num_locations = phrase_location.sa_high - phrase_location.sa_low # <<<<<<<<<<<<<< @@ -39980,7 +39394,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec */ __pyx_v_num_locations = (__pyx_v_phrase_location->sa_high - __pyx_v_phrase_location->sa_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":165 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":151 * if phrase_location.arr is None: * num_locations = phrase_location.sa_high - phrase_location.sa_low * if self.sample_size == -1 or num_locations <= self.sample_size: # <<<<<<<<<<<<<< @@ -39996,7 +39410,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":166 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":152 * num_locations = phrase_location.sa_high - phrase_location.sa_low * if self.sample_size == -1 or num_locations <= self.sample_size: * sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations) # <<<<<<<<<<<<<< @@ -40008,7 +39422,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":168 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":154 * sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations) * else: * stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<< @@ -40023,11 +39437,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":169 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":155 * else: * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.sa_low # <<<<<<<<<<<<<< @@ -40037,7 +39451,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_t_5 = __pyx_v_phrase_location->sa_low; __pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":170 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":156 * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.sa_low * while i < phrase_location.sa_high and sample.len < self.sample_size: # <<<<<<<<<<<<<< @@ -40054,7 +39468,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":173 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":159 * '''Note: int(i) not guaranteed to have the desired * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<< @@ -40064,7 +39478,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_t_2 = ((fmod(__pyx_v_i, 1.0) > 0.5) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":174 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":160 * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: * val = int(ceil(i)) # <<<<<<<<<<<<<< @@ -40076,7 +39490,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":176 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":162 * val = int(ceil(i)) * else: * val = int(floor(i)) # <<<<<<<<<<<<<< @@ -40087,7 +39501,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":177 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":163 * else: * val = int(floor(i)) * sample._append(self.sa.arr[val]) # <<<<<<<<<<<<<< @@ -40096,7 +39510,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_append(__pyx_v_sample, (__pyx_v_self->sa->arr[__pyx_v_val])); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":178 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":164 * val = int(floor(i)) * sample._append(self.sa.arr[val]) * i = i + stepsize # <<<<<<<<<<<<<< @@ -40111,7 +39525,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":180 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":166 * i = i + stepsize * else: * num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns # <<<<<<<<<<<<<< @@ -40127,7 +39541,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_phrase_location->num_subpatterns == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_5))) { #ifdef WITH_THREAD @@ -40137,11 +39551,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_num_locations = __Pyx_div_int(__pyx_t_5, __pyx_v_phrase_location->num_subpatterns); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":181 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":167 * else: * num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns * if self.sample_size == -1 or num_locations <= self.sample_size: # <<<<<<<<<<<<<< @@ -40157,7 +39571,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":182 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":168 * num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns * if self.sample_size == -1 or num_locations <= self.sample_size: * sample = phrase_location.arr # <<<<<<<<<<<<<< @@ -40172,7 +39586,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":184 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":170 * sample = phrase_location.arr * else: * stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<< @@ -40187,11 +39601,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":185 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":171 * else: * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.arr_low # <<<<<<<<<<<<<< @@ -40201,7 +39615,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_t_5 = __pyx_v_phrase_location->arr_low; __pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":186 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":172 * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.arr_low * while i < num_locations and sample.len < self.sample_size * phrase_location.num_subpatterns: # <<<<<<<<<<<<<< @@ -40218,7 +39632,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } if (!__pyx_t_4) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":189 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":175 * '''Note: int(i) not guaranteed to have the desired * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<< @@ -40228,7 +39642,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_t_4 = ((fmod(__pyx_v_i, 1.0) > 0.5) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":190 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":176 * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: * val = int(ceil(i)) # <<<<<<<<<<<<<< @@ -40240,7 +39654,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":192 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":178 * val = int(ceil(i)) * else: * val = int(floor(i)) # <<<<<<<<<<<<<< @@ -40251,7 +39665,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } __pyx_L11:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":193 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":179 * else: * val = int(floor(i)) * j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) # <<<<<<<<<<<<<< @@ -40260,7 +39674,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec */ __pyx_v_j = (__pyx_v_phrase_location->arr_low + (__pyx_v_val * __pyx_v_phrase_location->num_subpatterns)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":194 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":180 * val = int(floor(i)) * j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) * sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) # <<<<<<<<<<<<<< @@ -40269,7 +39683,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec */ ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":195 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":181 * j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) * sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) * i = i + stepsize # <<<<<<<<<<<<<< @@ -40283,7 +39697,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":196 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":182 * sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) * i = i + stepsize * return sample # <<<<<<<<<<<<<< @@ -40308,7 +39722,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":208 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":194 * * * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): # <<<<<<<<<<<<<< @@ -40320,7 +39734,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assign_matching", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":209 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":195 * * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): * m.arr = arr # <<<<<<<<<<<<<< @@ -40329,7 +39743,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa */ __pyx_v_m->arr = __pyx_v_arr; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":210 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":196 * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): * m.arr = arr * m.start = start # <<<<<<<<<<<<<< @@ -40338,7 +39752,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa */ __pyx_v_m->start = __pyx_v_start; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":211 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":197 * m.arr = arr * m.start = start * m.end = start + step # <<<<<<<<<<<<<< @@ -40347,7 +39761,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa */ __pyx_v_m->end = (__pyx_v_start + __pyx_v_step); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":212 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":198 * m.start = start * m.end = start + step * m.sent_id = sent_id_arr[arr[start]] # <<<<<<<<<<<<<< @@ -40356,7 +39770,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa */ __pyx_v_m->sent_id = (__pyx_v_sent_id_arr[(__pyx_v_arr[__pyx_v_start])]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":213 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":199 * m.end = start + step * m.sent_id = sent_id_arr[arr[start]] * m.size = step # <<<<<<<<<<<<<< @@ -40368,7 +39782,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":216 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":202 * * * cdef int* append_combined_matching(int* arr, Matching* loc1, Matching* loc2, # <<<<<<<<<<<<<< @@ -40385,7 +39799,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st int __pyx_t_2; __Pyx_RefNannySetupContext("append_combined_matching", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":220 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":206 * cdef int i, new_len * * new_len = result_len[0] + num_subpatterns # <<<<<<<<<<<<<< @@ -40394,7 +39808,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st */ __pyx_v_new_len = ((__pyx_v_result_len[0]) + __pyx_v_num_subpatterns); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":221 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":207 * * new_len = result_len[0] + num_subpatterns * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -40403,7 +39817,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":223 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":209 * arr = realloc(arr, new_len*sizeof(int)) * * for i from 0 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -40413,7 +39827,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st __pyx_t_1 = __pyx_v_loc1->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":224 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":210 * * for i from 0 <= i < loc1.size: * arr[result_len[0]+i] = loc1.arr[loc1.start+i] # <<<<<<<<<<<<<< @@ -40423,7 +39837,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st (__pyx_v_arr[((__pyx_v_result_len[0]) + __pyx_v_i)]) = (__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":225 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":211 * for i from 0 <= i < loc1.size: * arr[result_len[0]+i] = loc1.arr[loc1.start+i] * if num_subpatterns > loc1.size: # <<<<<<<<<<<<<< @@ -40433,7 +39847,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st __pyx_t_2 = ((__pyx_v_num_subpatterns > __pyx_v_loc1->size) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":226 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":212 * arr[result_len[0]+i] = loc1.arr[loc1.start+i] * if num_subpatterns > loc1.size: * arr[new_len-1] = loc2.arr[loc2.end-1] # <<<<<<<<<<<<<< @@ -40445,7 +39859,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":227 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":213 * if num_subpatterns > loc1.size: * arr[new_len-1] = loc2.arr[loc2.end-1] * result_len[0] = new_len # <<<<<<<<<<<<<< @@ -40454,7 +39868,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st */ (__pyx_v_result_len[0]) = __pyx_v_new_len; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":228 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":214 * arr[new_len-1] = loc2.arr[loc2.end-1] * result_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -40470,7 +39884,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":231 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":217 * * * cdef int* extend_arr(int* arr, int* arr_len, int* appendix, int appendix_len): # <<<<<<<<<<<<<< @@ -40484,7 +39898,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extend_arr", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":234 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":220 * cdef int new_len * * new_len = arr_len[0] + appendix_len # <<<<<<<<<<<<<< @@ -40493,7 +39907,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr */ __pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_appendix_len); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":235 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":221 * * new_len = arr_len[0] + appendix_len * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -40502,7 +39916,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":236 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":222 * new_len = arr_len[0] + appendix_len * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -40511,7 +39925,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr */ memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_appendix, (__pyx_v_appendix_len * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":237 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":223 * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) * arr_len[0] = new_len # <<<<<<<<<<<<<< @@ -40520,7 +39934,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr */ (__pyx_v_arr_len[0]) = __pyx_v_new_len; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":238 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":224 * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) * arr_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -40536,7 +39950,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":240 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":226 * return arr * * cdef int median(int low, int high, int step): # <<<<<<<<<<<<<< @@ -40553,7 +39967,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int int __pyx_clineno = 0; __Pyx_RefNannySetupContext("median", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":241 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":227 * * cdef int median(int low, int high, int step): * return low + (((high - low)/step)/2)*step # <<<<<<<<<<<<<< @@ -40569,7 +39983,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_1))) { #ifdef WITH_THREAD @@ -40579,7 +39993,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = (__pyx_v_low + (__Pyx_div_long(__Pyx_div_int(__pyx_t_1, __pyx_v_step), 2) * __pyx_v_step)); goto __pyx_L0; @@ -40594,7 +40008,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":244 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":230 * * * cdef void find_comparable_matchings(int low, int high, int* arr, int step, int loc, int* loc_minus, int* loc_plus): # <<<<<<<<<<<<<< @@ -40609,7 +40023,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in int __pyx_t_3; __Pyx_RefNannySetupContext("find_comparable_matchings", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":248 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":234 * # in which all matchings have the same first index as the one * # starting at loc * loc_plus[0] = loc + step # <<<<<<<<<<<<<< @@ -40618,7 +40032,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in */ (__pyx_v_loc_plus[0]) = (__pyx_v_loc + __pyx_v_step); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":249 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":235 * # starting at loc * loc_plus[0] = loc + step * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: # <<<<<<<<<<<<<< @@ -40635,7 +40049,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in } if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":250 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":236 * loc_plus[0] = loc + step * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: * loc_plus[0] = loc_plus[0] + step # <<<<<<<<<<<<<< @@ -40645,7 +40059,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in (__pyx_v_loc_plus[0]) = ((__pyx_v_loc_plus[0]) + __pyx_v_step); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":251 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":237 * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: * loc_plus[0] = loc_plus[0] + step * loc_minus[0] = loc # <<<<<<<<<<<<<< @@ -40654,7 +40068,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in */ (__pyx_v_loc_minus[0]) = __pyx_v_loc; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":252 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":238 * loc_plus[0] = loc_plus[0] + step * loc_minus[0] = loc * while loc_minus[0]-step >= low and arr[loc_minus[0]-step] == arr[loc]: # <<<<<<<<<<<<<< @@ -40671,7 +40085,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in } if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":253 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":239 * loc_minus[0] = loc * while loc_minus[0]-step >= low and arr[loc_minus[0]-step] == arr[loc]: * loc_minus[0] = loc_minus[0] - step # <<<<<<<<<<<<<< @@ -40718,7 +40132,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject 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_72,&__pyx_n_s__precompute_rank,&__pyx_n_s_107,&__pyx_n_s_108,&__pyx_n_s_73,&__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}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":317 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":303 * char* category="[X]", * # maximum number of contiguous chunks of terminal symbols in RHS of a rule. If None, defaults to max_nonterminals+1 * max_chunks=None, # <<<<<<<<<<<<<< @@ -40727,7 +40141,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject */ values[3] = ((PyObject *)Py_None); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":325 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":311 * unsigned max_nonterminals=2, * # maximum number of contiguous chunks of terminal symbols in target-side RHS of a rule. If None, defaults to max_nonterminals+1 * max_target_chunks=None, # <<<<<<<<<<<<<< @@ -40736,7 +40150,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject */ values[7] = ((PyObject *)Py_None); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":327 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":313 * max_target_chunks=None, * # maximum number of target side symbols (both T and NT) allowed in a rule. If None, defaults to max_initial_size * max_target_length=None, # <<<<<<<<<<<<<< @@ -40745,7 +40159,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject */ values[8] = ((PyObject *)Py_None); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":331 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":317 * unsigned min_gap_size=2, * # filename of file containing precomputed collocations * precompute_file=None, # <<<<<<<<<<<<<< @@ -40888,7 +40302,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject } } 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 = 309; __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[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -40919,10 +40333,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject } __pyx_v_alignment = ((struct __pyx_obj_4cdec_2sa_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 = 313; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __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 = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":313 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":299 * Alignment alignment, * # parameter for double-binary search; doesn't seem to matter much * float by_slack_factor=1.0, # <<<<<<<<<<<<<< @@ -40932,49 +40346,49 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject __pyx_v_by_slack_factor = ((float)1.0); } if (values[2]) { - __pyx_v_category = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_category = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_category = ((char *)__pyx_k_109); } __pyx_v_max_chunks = values[3]; if (values[4]) { - __pyx_v_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[4]); if (unlikely((__pyx_v_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[4]); if (unlikely((__pyx_v_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_max_initial_size = ((unsigned int)10); } if (values[5]) { - __pyx_v_max_length = __Pyx_PyInt_AsUnsignedInt(values[5]); if (unlikely((__pyx_v_max_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_length = __Pyx_PyInt_AsUnsignedInt(values[5]); if (unlikely((__pyx_v_max_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_max_length = ((unsigned int)5); } if (values[6]) { - __pyx_v_max_nonterminals = __Pyx_PyInt_AsUnsignedInt(values[6]); if (unlikely((__pyx_v_max_nonterminals == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_nonterminals = __Pyx_PyInt_AsUnsignedInt(values[6]); if (unlikely((__pyx_v_max_nonterminals == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_max_nonterminals = ((unsigned int)2); } __pyx_v_max_target_chunks = values[7]; __pyx_v_max_target_length = values[8]; if (values[9]) { - __pyx_v_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[9]); if (unlikely((__pyx_v_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[9]); if (unlikely((__pyx_v_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_min_gap_size = ((unsigned int)2); } __pyx_v_precompute_file = values[10]; if (values[11]) { - __pyx_v_precompute_secondary_rank = __Pyx_PyInt_AsUnsignedInt(values[11]); if (unlikely((__pyx_v_precompute_secondary_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_precompute_secondary_rank = __Pyx_PyInt_AsUnsignedInt(values[11]); if (unlikely((__pyx_v_precompute_secondary_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_precompute_secondary_rank = ((unsigned int)20); } if (values[12]) { - __pyx_v_precompute_rank = __Pyx_PyInt_AsUnsignedInt(values[12]); if (unlikely((__pyx_v_precompute_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_precompute_rank = __Pyx_PyInt_AsUnsignedInt(values[12]); if (unlikely((__pyx_v_precompute_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_precompute_rank = ((unsigned int)100); } if (values[13]) { - __pyx_v_require_aligned_terminal = __Pyx_PyObject_IsTrue(values[13]); if (unlikely((__pyx_v_require_aligned_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_require_aligned_terminal = __Pyx_PyObject_IsTrue(values[13]); if (unlikely((__pyx_v_require_aligned_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":337 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":323 * unsigned precompute_rank=100, * # require extracted rules to have at least one aligned word * bint require_aligned_terminal=True, # <<<<<<<<<<<<<< @@ -40984,10 +40398,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject __pyx_v_require_aligned_terminal = ((int)1); } if (values[14]) { - __pyx_v_require_aligned_chunks = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_require_aligned_chunks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_require_aligned_chunks = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_require_aligned_chunks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":339 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":325 * bint require_aligned_terminal=True, * # require each contiguous chunk of extracted rules to have at least one aligned word * bint require_aligned_chunks=False, # <<<<<<<<<<<<<< @@ -40997,20 +40411,20 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject __pyx_v_require_aligned_chunks = ((int)0); } if (values[15]) { - __pyx_v_train_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[15]); if (unlikely((__pyx_v_train_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_train_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[15]); if (unlikely((__pyx_v_train_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_train_max_initial_size = ((unsigned int)10); } if (values[16]) { - __pyx_v_train_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[16]); if (unlikely((__pyx_v_train_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_train_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[16]); if (unlikely((__pyx_v_train_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_train_min_gap_size = ((unsigned int)2); } if (values[17]) { - __pyx_v_tight_phrases = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_tight_phrases == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_tight_phrases = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_tight_phrases == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":345 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":331 * unsigned train_min_gap_size=2, * # False if phrases should be loose (better but slower), True otherwise * bint tight_phrases=True, # <<<<<<<<<<<<<< @@ -41020,10 +40434,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject __pyx_v_tight_phrases = ((int)1); } if (values[18]) { - __pyx_v_use_baeza_yates = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_use_baeza_yates == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_use_baeza_yates = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_use_baeza_yates == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":347 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":333 * bint tight_phrases=True, * # True to require use of double-binary alg, false otherwise * bint use_baeza_yates=True, # <<<<<<<<<<<<<< @@ -41033,10 +40447,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject __pyx_v_use_baeza_yates = ((int)1); } if (values[19]) { - __pyx_v_use_collocations = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_use_collocations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_use_collocations = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_use_collocations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":349 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":335 * bint use_baeza_yates=True, * # True to enable used of precomputed collocations * bint use_collocations=True, # <<<<<<<<<<<<<< @@ -41046,10 +40460,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject __pyx_v_use_collocations = ((int)1); } if (values[20]) { - __pyx_v_use_index = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_use_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_use_index = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_use_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":351 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":337 * bint use_collocations=True, * # True to enable use of precomputed inverted indices * bint use_index=True): # <<<<<<<<<<<<<< @@ -41061,13 +40475,13 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._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_4cdec_2sa_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_4cdec_2sa_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(((struct __pyx_obj_4cdec_2sa_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:; @@ -41077,7 +40491,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":309 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":295 * cdef online_stats * * def __cinit__(self, # <<<<<<<<<<<<<< @@ -41099,21 +40513,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":357 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":343 * respectively. This is because Chiang's model does not require * them to be the same, therefore we don't either.''' * self.rules = TrieTable(True) # cache # <<<<<<<<<<<<<< * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: */ - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 343; __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 = 357; __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 = 343; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 343; __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); @@ -41122,20 +40536,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_v_self->rules = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":358 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":344 * them to be the same, therefore we don't either.''' * self.rules = TrieTable(True) # cache * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<< * if alignment is None: * raise Exception("Must specify an alignment object") */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __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 = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __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_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __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); @@ -41144,7 +40558,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_v_self->rules->root = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":359 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":345 * self.rules = TrieTable(True) # cache * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: # <<<<<<<<<<<<<< @@ -41155,23 +40569,23 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":360 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":346 * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: * raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<< * self.alignment = alignment * */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":361 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":347 * if alignment is None: * raise Exception("Must specify an alignment object") * self.alignment = alignment # <<<<<<<<<<<<<< @@ -41184,7 +40598,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __Pyx_DECREF(((PyObject *)__pyx_v_self->alignment)); __pyx_v_self->alignment = __pyx_v_alignment; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":365 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":351 * # grammar parameters and settings * # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero * self.max_length = max_length # <<<<<<<<<<<<<< @@ -41193,7 +40607,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->max_length = __pyx_v_max_length; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":366 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":352 * # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero * self.max_length = max_length * self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<< @@ -41202,7 +40616,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->max_nonterminals = __pyx_v_max_nonterminals; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":367 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":353 * self.max_length = max_length * self.max_nonterminals = max_nonterminals * self.max_initial_size = max_initial_size # <<<<<<<<<<<<<< @@ -41211,7 +40625,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->max_initial_size = __pyx_v_max_initial_size; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":368 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":354 * self.max_nonterminals = max_nonterminals * self.max_initial_size = max_initial_size * self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<< @@ -41220,7 +40634,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->train_max_initial_size = __pyx_v_train_max_initial_size; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":369 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":355 * self.max_initial_size = max_initial_size * self.train_max_initial_size = train_max_initial_size * self.min_gap_size = min_gap_size # <<<<<<<<<<<<<< @@ -41229,7 +40643,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->min_gap_size = __pyx_v_min_gap_size; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":370 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":356 * self.train_max_initial_size = train_max_initial_size * self.min_gap_size = min_gap_size * self.train_min_gap_size = train_min_gap_size # <<<<<<<<<<<<<< @@ -41238,7 +40652,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->train_min_gap_size = __pyx_v_train_min_gap_size; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":371 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":357 * self.min_gap_size = min_gap_size * self.train_min_gap_size = train_min_gap_size * self.category = sym_fromstring(category, False) # <<<<<<<<<<<<<< @@ -41247,7 +40661,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->category = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_v_category, 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":373 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":359 * self.category = sym_fromstring(category, False) * * if max_chunks is None: # <<<<<<<<<<<<<< @@ -41258,7 +40672,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":374 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":360 * * if max_chunks is None: * self.max_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<< @@ -41270,19 +40684,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":376 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":362 * self.max_chunks = self.max_nonterminals + 1 * else: * self.max_chunks = max_chunks # <<<<<<<<<<<<<< * * if max_target_chunks is None: */ - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_chunks = __pyx_t_5; } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":378 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":364 * self.max_chunks = max_chunks * * if max_target_chunks is None: # <<<<<<<<<<<<<< @@ -41293,7 +40707,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":379 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":365 * * if max_target_chunks is None: * self.max_target_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<< @@ -41305,19 +40719,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":381 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":367 * self.max_target_chunks = self.max_nonterminals + 1 * else: * self.max_target_chunks = max_target_chunks # <<<<<<<<<<<<<< * * if max_target_length is None: */ - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_target_chunks = __pyx_t_5; } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":383 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":369 * self.max_target_chunks = max_target_chunks * * if max_target_length is None: # <<<<<<<<<<<<<< @@ -41328,7 +40742,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":384 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":370 * * if max_target_length is None: * self.max_target_length = max_initial_size # <<<<<<<<<<<<<< @@ -41340,26 +40754,26 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":386 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":372 * self.max_target_length = max_initial_size * else: * self.max_target_length = max_target_length # <<<<<<<<<<<<<< * * # algorithmic parameters and settings */ - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_target_length = __pyx_t_5; } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":389 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":375 * * # algorithmic parameters and settings * self.precomputed_collocations = {} # <<<<<<<<<<<<<< * self.precomputed_index = {} * self.use_index = use_index */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __Pyx_GOTREF(__pyx_v_self->precomputed_collocations); @@ -41367,14 +40781,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_v_self->precomputed_collocations = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":390 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":376 * # algorithmic parameters and settings * self.precomputed_collocations = {} * self.precomputed_index = {} # <<<<<<<<<<<<<< * self.use_index = use_index * self.use_collocations = use_collocations */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __Pyx_GOTREF(__pyx_v_self->precomputed_index); @@ -41382,7 +40796,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_v_self->precomputed_index = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":391 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":377 * self.precomputed_collocations = {} * self.precomputed_index = {} * self.use_index = use_index # <<<<<<<<<<<<<< @@ -41391,7 +40805,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->use_index = __pyx_v_use_index; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":392 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":378 * self.precomputed_index = {} * self.use_index = use_index * self.use_collocations = use_collocations # <<<<<<<<<<<<<< @@ -41400,14 +40814,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->use_collocations = __pyx_v_use_collocations; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":393 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":379 * self.use_index = use_index * self.use_collocations = use_collocations * self.max_rank = {} # <<<<<<<<<<<<<< * self.precompute_file = precompute_file * self.precompute_rank = precompute_rank */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __Pyx_GOTREF(__pyx_v_self->max_rank); @@ -41415,7 +40829,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_v_self->max_rank = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":394 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":380 * self.use_collocations = use_collocations * self.max_rank = {} * self.precompute_file = precompute_file # <<<<<<<<<<<<<< @@ -41428,7 +40842,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __Pyx_DECREF(__pyx_v_self->precompute_file); __pyx_v_self->precompute_file = __pyx_v_precompute_file; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":395 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":381 * self.max_rank = {} * self.precompute_file = precompute_file * self.precompute_rank = precompute_rank # <<<<<<<<<<<<<< @@ -41437,7 +40851,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->precompute_rank = __pyx_v_precompute_rank; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":396 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":382 * self.precompute_file = precompute_file * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<< @@ -41446,7 +40860,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->precompute_secondary_rank = __pyx_v_precompute_secondary_rank; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":397 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":383 * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank * self.use_baeza_yates = use_baeza_yates # <<<<<<<<<<<<<< @@ -41455,7 +40869,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->use_baeza_yates = __pyx_v_use_baeza_yates; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":398 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":384 * self.precompute_secondary_rank = precompute_secondary_rank * self.use_baeza_yates = use_baeza_yates * self.by_slack_factor = by_slack_factor # <<<<<<<<<<<<<< @@ -41464,7 +40878,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->by_slack_factor = __pyx_v_by_slack_factor; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":399 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":385 * self.use_baeza_yates = use_baeza_yates * self.by_slack_factor = by_slack_factor * self.tight_phrases = tight_phrases # <<<<<<<<<<<<<< @@ -41473,7 +40887,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->tight_phrases = __pyx_v_tight_phrases; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":401 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":387 * self.tight_phrases = tight_phrases * * if require_aligned_chunks: # <<<<<<<<<<<<<< @@ -41483,7 +40897,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_3 = (__pyx_v_require_aligned_chunks != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":403 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":389 * if require_aligned_chunks: * # one condition is a stronger version of the other. * self.require_aligned_chunks = self.require_aligned_terminal = True # <<<<<<<<<<<<<< @@ -41495,7 +40909,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ goto __pyx_L7; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":404 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":390 * # one condition is a stronger version of the other. * self.require_aligned_chunks = self.require_aligned_terminal = True * elif require_aligned_terminal: # <<<<<<<<<<<<<< @@ -41505,7 +40919,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_3 = (__pyx_v_require_aligned_terminal != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":405 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":391 * self.require_aligned_chunks = self.require_aligned_terminal = True * elif require_aligned_terminal: * self.require_aligned_chunks = False # <<<<<<<<<<<<<< @@ -41514,7 +40928,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->require_aligned_chunks = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":406 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":392 * elif require_aligned_terminal: * self.require_aligned_chunks = False * self.require_aligned_terminal = True # <<<<<<<<<<<<<< @@ -41526,7 +40940,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":408 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":394 * self.require_aligned_terminal = True * else: * self.require_aligned_chunks = self.require_aligned_terminal = False # <<<<<<<<<<<<<< @@ -41538,7 +40952,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":411 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":397 * * # diagnostics * self.prev_norm_prefix = () # <<<<<<<<<<<<<< @@ -41551,17 +40965,17 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __Pyx_DECREF(__pyx_v_self->prev_norm_prefix); __pyx_v_self->prev_norm_prefix = ((PyObject *)__pyx_empty_tuple); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":413 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":399 * self.prev_norm_prefix = () * * self.findexes = IntList(initial_len=10) # <<<<<<<<<<<<<< * self.findexes1 = IntList(initial_len=10) * */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 399; __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); @@ -41570,17 +40984,17 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_v_self->findexes = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":414 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":400 * * self.findexes = IntList(initial_len=10) * self.findexes1 = IntList(initial_len=10) # <<<<<<<<<<<<<< * * # Online stats */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __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); @@ -41589,7 +41003,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_v_self->findexes1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":419 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":405 * * # True after data is added * self.online = False # <<<<<<<<<<<<<< @@ -41598,21 +41012,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->online = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":420 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":406 * # True after data is added * self.online = False * self.online_stats = defaultdict(OnlineStats) # <<<<<<<<<<<<<< * * def configure(self, SuffixArray fsarray, DataArray edarray, */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __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 = 420; __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 = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_OnlineStats))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_OnlineStats))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_OnlineStats))); - __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; @@ -41671,21 +41085,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__edarray)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sampler)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scorer)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "configure") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "configure") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -41702,16 +41116,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._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_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_4cdec_2sa_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_4cdec_2sa_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_4cdec_2sa_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_4cdec_2sa_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_4cdec_2sa_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_4cdec_2sa_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fsarray, __pyx_v_edarray, __pyx_v_sampler, __pyx_v_scorer); goto __pyx_L0; __pyx_L1_error:; @@ -41721,7 +41135,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(Py return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":422 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":408 * self.online_stats = defaultdict(OnlineStats) * * def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<< @@ -41739,7 +41153,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("configure", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":427 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":413 * Here we also use it to precompute the most expensive intersections * in the corpus quickly.''' * self.fsa = fsarray # <<<<<<<<<<<<<< @@ -41752,7 +41166,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st __Pyx_DECREF(((PyObject *)__pyx_v_self->fsa)); __pyx_v_self->fsa = __pyx_v_fsarray; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":428 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":414 * in the corpus quickly.''' * self.fsa = fsarray * self.fda = fsarray.darray # <<<<<<<<<<<<<< @@ -41767,7 +41181,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st __pyx_v_self->fda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":429 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":415 * self.fsa = fsarray * self.fda = fsarray.darray * self.eda = edarray # <<<<<<<<<<<<<< @@ -41780,7 +41194,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st __Pyx_DECREF(((PyObject *)__pyx_v_self->eda)); __pyx_v_self->eda = __pyx_v_edarray; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":430 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":416 * self.fda = fsarray.darray * self.eda = edarray * self.fid2symid = self.set_idmap(self.fda) # <<<<<<<<<<<<<< @@ -41789,17 +41203,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st */ __pyx_t_1 = ((PyObject *)__pyx_v_self->fda); __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 416; __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_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 416; __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_4cdec_2sa_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":431 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":417 * self.eda = edarray * self.fid2symid = self.set_idmap(self.fda) * self.eid2symid = self.set_idmap(self.eda) # <<<<<<<<<<<<<< @@ -41808,31 +41222,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st */ __pyx_t_2 = ((PyObject *)__pyx_v_self->eda); __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 417; __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_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 417; __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_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":432 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":418 * self.fid2symid = self.set_idmap(self.fda) * self.eid2symid = self.set_idmap(self.eda) * self.precompute() # <<<<<<<<<<<<<< * self.sampler = sampler * self.scorer = scorer */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 418; __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 = 432; __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 = 418; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":433 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":419 * self.eid2symid = self.set_idmap(self.eda) * self.precompute() * self.sampler = sampler # <<<<<<<<<<<<<< @@ -41845,7 +41259,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st __Pyx_DECREF(((PyObject *)__pyx_v_self->sampler)); __pyx_v_self->sampler = __pyx_v_sampler; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":434 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":420 * self.precompute() * self.sampler = sampler * self.scorer = scorer # <<<<<<<<<<<<<< @@ -41871,7 +41285,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":436 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":422 * self.scorer = scorer * * cdef set_idmap(self, DataArray darray): # <<<<<<<<<<<<<< @@ -41896,7 +41310,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_idmap", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":440 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":426 * cdef IntList idmap * * N = len(darray.id2word) # <<<<<<<<<<<<<< @@ -41905,30 +41319,30 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH */ __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[8]; __pyx_lineno = 440; __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[8]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_N = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":441 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":427 * * N = len(darray.id2word) * idmap = IntList(initial_len=N) # <<<<<<<<<<<<<< * for word_id from 0 <= word_id < N: * new_word_id = sym_fromstring(darray.id2word[word_id], True) */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 427; __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[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 427; __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[8]; __pyx_lineno = 441; __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[8]; __pyx_lineno = 427; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 427; __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_4cdec_2sa_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":442 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":428 * N = len(darray.id2word) * idmap = IntList(initial_len=N) * for word_id from 0 <= word_id < N: # <<<<<<<<<<<<<< @@ -41938,20 +41352,20 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH __pyx_t_4 = __pyx_v_N; for (__pyx_v_word_id = 0; __pyx_v_word_id < __pyx_t_4; __pyx_v_word_id++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":443 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":429 * idmap = IntList(initial_len=N) * for word_id from 0 <= word_id < N: * new_word_id = sym_fromstring(darray.id2word[word_id], True) # <<<<<<<<<<<<<< * idmap.arr[word_id] = new_word_id * return idmap */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_darray->id2word, __pyx_v_word_id, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_darray->id2word, __pyx_v_word_id, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_new_word_id = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_5, 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":444 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":430 * for word_id from 0 <= word_id < N: * new_word_id = sym_fromstring(darray.id2word[word_id], True) * idmap.arr[word_id] = new_word_id # <<<<<<<<<<<<<< @@ -41961,7 +41375,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH (__pyx_v_idmap->arr[__pyx_v_word_id]) = __pyx_v_new_word_id; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":445 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":431 * new_word_id = sym_fromstring(darray.id2word[word_id], True) * idmap.arr[word_id] = new_word_id * return idmap # <<<<<<<<<<<<<< @@ -41998,7 +41412,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5pattern2phra return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":448 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":434 * * * def pattern2phrase(self, pattern): # <<<<<<<<<<<<<< @@ -42026,7 +41440,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pattern2phrase", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":450 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":436 * def pattern2phrase(self, pattern): * # pattern is a tuple, which we must convert to a hiero Phrase * result = () # <<<<<<<<<<<<<< @@ -42036,7 +41450,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __pyx_v_result = __pyx_empty_tuple; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":451 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":437 * # pattern is a tuple, which we must convert to a hiero Phrase * result = () * arity = 0 # <<<<<<<<<<<<<< @@ -42046,7 +41460,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra __Pyx_INCREF(__pyx_int_0); __pyx_v_arity = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":452 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":438 * result = () * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -42057,7 +41471,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra __pyx_t_1 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -42065,23 +41479,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -42090,73 +41504,73 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra __Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":453 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":439 * arity = 0 * for word_id in pattern: * if word_id == -1: # <<<<<<<<<<<<<< * arity = arity + 1 * new_id = sym_setindex(self.category, arity) */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":454 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":440 * for word_id in pattern: * if word_id == -1: * arity = arity + 1 # <<<<<<<<<<<<<< * new_id = sym_setindex(self.category, arity) * else: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); 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_DECREF_SET(__pyx_v_arity, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":455 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":441 * if word_id == -1: * arity = arity + 1 * new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<< * else: * 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 = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6); goto __pyx_L5; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":457 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":443 * new_id = sym_setindex(self.category, arity) * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<< * result = result + (new_id,) * return Phrase(result) */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_7, 1); } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":458 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":444 * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) # <<<<<<<<<<<<<< * return Phrase(result) * */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __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); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); @@ -42164,7 +41578,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":459 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":445 * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) * return Phrase(result) # <<<<<<<<<<<<<< @@ -42172,12 +41586,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra * def pattern2phrase_plus(self, pattern): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __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 = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __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_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; @@ -42212,7 +41626,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_7pattern2phra return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":461 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":447 * return Phrase(result) * * def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<< @@ -42242,19 +41656,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pattern2phrase_plus", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":464 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":450 * # returns a list containing both the pattern, and pattern * # suffixed/prefixed with the NT category. * patterns = [] # <<<<<<<<<<<<<< * result = () * arity = 0 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __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 = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_patterns = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":465 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":451 * # suffixed/prefixed with the NT category. * patterns = [] * result = () # <<<<<<<<<<<<<< @@ -42264,7 +41678,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __pyx_v_result = __pyx_empty_tuple; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":466 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":452 * patterns = [] * result = () * arity = 0 # <<<<<<<<<<<<<< @@ -42274,7 +41688,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra __Pyx_INCREF(__pyx_int_0); __pyx_v_arity = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":467 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":453 * result = () * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -42285,7 +41699,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra __pyx_t_1 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -42293,23 +41707,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -42318,73 +41732,73 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra __Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":468 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":454 * arity = 0 * for word_id in pattern: * if word_id == -1: # <<<<<<<<<<<<<< * arity = arity + 1 * new_id = sym_setindex(self.category, arity) */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":469 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":455 * for word_id in pattern: * if word_id == -1: * arity = arity + 1 # <<<<<<<<<<<<<< * new_id = sym_setindex(self.category, arity) * else: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_arity, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":470 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":456 * if word_id == -1: * arity = arity + 1 * new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<< * else: * 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 = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6); goto __pyx_L5; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":472 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":458 * new_id = sym_setindex(self.category, arity) * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<< * result = result + (new_id,) * patterns.append(Phrase(result)) */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_7, 1); } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":473 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":459 * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) # <<<<<<<<<<<<<< * patterns.append(Phrase(result)) * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __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); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); @@ -42392,81 +41806,81 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":474 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":460 * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) * patterns.append(Phrase(result)) # <<<<<<<<<<<<<< * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __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 = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __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_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":475 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":461 * result = result + (new_id,) * patterns.append(Phrase(result)) * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) # <<<<<<<<<<<<<< * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) * return patterns */ - __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __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 = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __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 = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":476 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":462 * patterns.append(Phrase(result)) * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) # <<<<<<<<<<<<<< * return patterns * */ - __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __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 = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __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 = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":477 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":463 * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) * return patterns # <<<<<<<<<<<<<< @@ -42507,7 +41921,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9precompute(P return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":479 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":465 * return patterns * * def precompute(self): # <<<<<<<<<<<<<< @@ -42542,7 +41956,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("precompute", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":482 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":468 * cdef Precomputation pre * * if self.precompute_file is not None: # <<<<<<<<<<<<<< @@ -42553,34 +41967,34 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":483 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":469 * * if self.precompute_file is not None: * start_time = monitor_cpu() # <<<<<<<<<<<<<< * logger.info("Reading precomputed data from file %s... ", self.precompute_file) * pre = Precomputation(from_binary=self.precompute_file) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_start_time = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":484 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":470 * if self.precompute_file is not None: * start_time = monitor_cpu() * logger.info("Reading precomputed data from file %s... ", self.precompute_file) # <<<<<<<<<<<<<< * pre = Precomputation(from_binary=self.precompute_file) * # check parameters of precomputation -- some are critical and some are not */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_s_112)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_112)); @@ -42588,29 +42002,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_INCREF(__pyx_v_self->precompute_file); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->precompute_file); __Pyx_GIVEREF(__pyx_v_self->precompute_file); - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __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[8]; __pyx_lineno = 470; __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; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":485 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":471 * start_time = monitor_cpu() * logger.info("Reading precomputed data from file %s... ", self.precompute_file) * pre = Precomputation(from_binary=self.precompute_file) # <<<<<<<<<<<<<< * # check parameters of precomputation -- some are critical and some are not * if pre.max_nonterminals != self.max_nonterminals: */ - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __pyx_v_pre = ((struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":487 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":473 * pre = Precomputation(from_binary=self.precompute_file) * # check parameters of precomputation -- some are critical and some are not * if pre.max_nonterminals != self.max_nonterminals: # <<<<<<<<<<<<<< @@ -42620,23 +42034,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = ((__pyx_v_pre->max_nonterminals != __pyx_v_self->max_nonterminals) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":488 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":474 * # check parameters of precomputation -- some are critical and some are not * if pre.max_nonterminals != self.max_nonterminals: * logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals) # <<<<<<<<<<<<<< * if pre.max_length != self.max_length: * logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_kp_s_113)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_113)); @@ -42647,7 +42061,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_GIVEREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __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_6)); __pyx_t_6 = 0; @@ -42656,7 +42070,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":489 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":475 * if pre.max_nonterminals != self.max_nonterminals: * logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals) * if pre.max_length != self.max_length: # <<<<<<<<<<<<<< @@ -42666,23 +42080,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = ((__pyx_v_pre->max_length != __pyx_v_self->max_length) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":490 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":476 * logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals) * if pre.max_length != self.max_length: * logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) # <<<<<<<<<<<<<< * if pre.train_max_initial_size != self.train_max_initial_size: * raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromLong(__pyx_v_pre->max_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_pre->max_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyInt_FromLong(__pyx_v_self->max_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_self->max_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_s_114)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_114)); @@ -42693,7 +42107,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_GIVEREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; @@ -42702,7 +42116,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":491 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":477 * if pre.max_length != self.max_length: * logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) * if pre.train_max_initial_size != self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -42712,18 +42126,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = ((__pyx_v_pre->train_max_initial_size != __pyx_v_self->train_max_initial_size) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":492 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":478 * logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) * if pre.train_max_initial_size != self.train_max_initial_size: * raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) # <<<<<<<<<<<<<< * if pre.train_min_gap_size != self.train_min_gap_size: * raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -42731,25 +42145,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_GIVEREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_115), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_115), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":493 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":479 * if pre.train_max_initial_size != self.train_max_initial_size: * raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) * if pre.train_min_gap_size != self.train_min_gap_size: # <<<<<<<<<<<<<< @@ -42759,18 +42173,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = ((__pyx_v_pre->train_min_gap_size != __pyx_v_self->train_min_gap_size) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":494 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":480 * raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) * if pre.train_min_gap_size != self.train_min_gap_size: * raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) # <<<<<<<<<<<<<< * if self.use_index: * logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -42778,25 +42192,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_GIVEREF(__pyx_t_6); __pyx_t_4 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_116), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_116), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6)); __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":495 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":481 * if pre.train_min_gap_size != self.train_min_gap_size: * raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) * if self.use_index: # <<<<<<<<<<<<<< @@ -42806,25 +42220,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = (__pyx_v_self->use_index != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":496 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":482 * raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) * if self.use_index: * logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) # <<<<<<<<<<<<<< * for pattern, arr in pre.precomputed_index.iteritems(): * phrases = self.pattern2phrase_plus(pattern) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __pyx_v_pre->precomputed_index; __Pyx_INCREF(__pyx_t_6); - __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_s_117)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_117)); @@ -42832,13 +42246,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":497 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":483 * if self.use_index: * logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) * for pattern, arr in pre.precomputed_index.iteritems(): # <<<<<<<<<<<<<< @@ -42848,9 +42262,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_7 = 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 = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_4; @@ -42858,7 +42272,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, &__pyx_t_4, &__pyx_t_5, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_4); @@ -42866,28 +42280,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":498 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":484 * logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) * for pattern, arr in pre.precomputed_index.iteritems(): * phrases = self.pattern2phrase_plus(pattern) # <<<<<<<<<<<<<< * for phrase in phrases: * self.precomputed_index[phrase] = arr */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __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[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_pattern); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pattern); __Pyx_GIVEREF(__pyx_v_pattern); - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __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[8]; __pyx_lineno = 484; __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; __Pyx_XDECREF_SET(__pyx_v_phrases, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":499 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":485 * for pattern, arr in pre.precomputed_index.iteritems(): * phrases = self.pattern2phrase_plus(pattern) * for phrase in phrases: # <<<<<<<<<<<<<< @@ -42898,7 +42312,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_3 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_3); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -42906,23 +42320,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_12(__pyx_t_3); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -42931,14 +42345,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_XDECREF_SET(__pyx_v_phrase, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":500 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":486 * phrases = self.pattern2phrase_plus(pattern) * for phrase in phrases: * self.precomputed_index[phrase] = arr # <<<<<<<<<<<<<< * if self.use_collocations: * logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) */ - if (PyObject_SetItem(__pyx_v_self->precomputed_index, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_self->precomputed_index, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -42947,7 +42361,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":501 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":487 * for phrase in phrases: * self.precomputed_index[phrase] = arr * if self.use_collocations: # <<<<<<<<<<<<<< @@ -42957,25 +42371,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = (__pyx_v_self->use_collocations != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":502 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":488 * self.precomputed_index[phrase] = arr * if self.use_collocations: * logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) # <<<<<<<<<<<<<< * for pattern, arr in pre.precomputed_collocations.iteritems(): * phrase = self.pattern2phrase(pattern) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __pyx_v_pre->precomputed_collocations; __Pyx_INCREF(__pyx_t_6); - __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_s_118)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_118)); @@ -42983,13 +42397,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":503 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":489 * if self.use_collocations: * logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) * for pattern, arr in pre.precomputed_collocations.iteritems(): # <<<<<<<<<<<<<< @@ -42999,9 +42413,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_8 = 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 = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_4; @@ -43009,7 +42423,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_7, &__pyx_t_8, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_4); @@ -43017,71 +42431,71 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":504 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":490 * logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) * for pattern, arr in pre.precomputed_collocations.iteritems(): * phrase = self.pattern2phrase(pattern) # <<<<<<<<<<<<<< * self.precomputed_collocations[phrase] = arr * stop_time = monitor_cpu() */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __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[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_pattern); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pattern); __Pyx_GIVEREF(__pyx_v_pattern); - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __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[8]; __pyx_lineno = 490; __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; __Pyx_XDECREF_SET(__pyx_v_phrase, __pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":505 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":491 * for pattern, arr in pre.precomputed_collocations.iteritems(): * phrase = self.pattern2phrase(pattern) * self.precomputed_collocations[phrase] = arr # <<<<<<<<<<<<<< * stop_time = monitor_cpu() * logger.info("Processing precomputations took %f seconds", stop_time - start_time) */ - if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13; } __pyx_L13:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":506 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":492 * phrase = self.pattern2phrase(pattern) * self.precomputed_collocations[phrase] = arr * stop_time = monitor_cpu() # <<<<<<<<<<<<<< * logger.info("Processing precomputations took %f seconds", stop_time - start_time) * */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_stop_time = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":507 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":493 * self.precomputed_collocations[phrase] = arr * stop_time = monitor_cpu() * logger.info("Processing precomputations took %f seconds", stop_time - start_time) # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Subtract(__pyx_v_stop_time, __pyx_v_start_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_stop_time, __pyx_v_start_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __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[8]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_s_119)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_119)); @@ -43089,7 +42503,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; @@ -43131,7 +42545,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_11get_precomp return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":510 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":496 * * * def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<< @@ -43154,30 +42568,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_precomputed_collocation", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":511 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":497 * * def get_precomputed_collocation(self, phrase): * if phrase in self.precomputed_collocations: # <<<<<<<<<<<<<< * arr = self.precomputed_collocations[phrase] * return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) */ - __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_phrase, __pyx_v_self->precomputed_collocations, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_phrase, __pyx_v_self->precomputed_collocations, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":512 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":498 * def get_precomputed_collocation(self, phrase): * if phrase in self.precomputed_collocations: * arr = self.precomputed_collocations[phrase] # <<<<<<<<<<<<<< * return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) * return None */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_arr = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":513 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":499 * if phrase in self.precomputed_collocations: * arr = self.precomputed_collocations[phrase] * return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) # <<<<<<<<<<<<<< @@ -43185,26 +42599,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr), __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr), __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -43214,7 +42628,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":514 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":500 * arr = self.precomputed_collocations[phrase] * return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) * return None # <<<<<<<<<<<<<< @@ -43241,7 +42655,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":517 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":503 * * * cdef int* baeza_yates_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -43287,7 +42701,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("baeza_yates_helper", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":530 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":516 * cdef Matching loc1, loc2 * * result = malloc(0*sizeof(int*)) # <<<<<<<<<<<<<< @@ -43296,7 +42710,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_result = ((int *)malloc((0 * (sizeof(int *))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":532 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":518 * result = malloc(0*sizeof(int*)) * * d_first = 0 # <<<<<<<<<<<<<< @@ -43305,7 +42719,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_d_first = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":533 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":519 * * d_first = 0 * if high1 - low1 > high2 - low2: # <<<<<<<<<<<<<< @@ -43315,7 +42729,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_1 = (((__pyx_v_high1 - __pyx_v_low1) > (__pyx_v_high2 - __pyx_v_low2)) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":534 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":520 * d_first = 0 * if high1 - low1 > high2 - low2: * d_first = 1 # <<<<<<<<<<<<<< @@ -43327,7 +42741,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":538 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":524 * # First, check to see if we are at any of the recursive base cases * # Case 1: one of the sets is empty * if low1 >= high1 or low2 >= high2: # <<<<<<<<<<<<<< @@ -43343,7 +42757,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":539 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":525 * # Case 1: one of the sets is empty * if low1 >= high1 or low2 >= high2: * return result # <<<<<<<<<<<<<< @@ -43356,7 +42770,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":542 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":528 * * # Case 2: sets are non-overlapping * assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43365,7 +42779,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":543 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":529 * # Case 2: sets are non-overlapping * assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) * assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43374,7 +42788,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_low2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":544 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":530 * assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) * assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == -1: # <<<<<<<<<<<<<< @@ -43384,7 +42798,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":545 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":531 * assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == -1: * return result # <<<<<<<<<<<<<< @@ -43397,7 +42811,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":547 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":533 * return result * * assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43406,7 +42820,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_low1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":548 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":534 * * assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) * assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43415,7 +42829,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":549 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":535 * assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) * assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: # <<<<<<<<<<<<<< @@ -43425,7 +42839,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":550 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":536 * assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: * return result # <<<<<<<<<<<<<< @@ -43438,7 +42852,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":554 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":540 * # Case 3: query set and data set do not meet size mismatch constraints; * # We use mergesort instead in this case * qsetsize = (high1-low1) / step1 # <<<<<<<<<<<<<< @@ -43454,7 +42868,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step1 == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) { #ifdef WITH_THREAD @@ -43464,11 +42878,11 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_qsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":555 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":541 * # We use mergesort instead in this case * qsetsize = (high1-low1) / step1 * dsetsize = (high2-low2) / step2 # <<<<<<<<<<<<<< @@ -43484,7 +42898,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step2 == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) { #ifdef WITH_THREAD @@ -43494,11 +42908,11 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_dsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":556 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":542 * qsetsize = (high1-low1) / step1 * dsetsize = (high2-low2) / step2 * if d_first: # <<<<<<<<<<<<<< @@ -43508,7 +42922,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = (__pyx_v_d_first != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":557 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":543 * dsetsize = (high2-low2) / step2 * if d_first: * tmp = qsetsize # <<<<<<<<<<<<<< @@ -43517,7 +42931,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_tmp = __pyx_v_qsetsize; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":558 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":544 * if d_first: * tmp = qsetsize * qsetsize = dsetsize # <<<<<<<<<<<<<< @@ -43526,7 +42940,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_qsetsize = __pyx_v_dsetsize; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":559 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":545 * tmp = qsetsize * qsetsize = dsetsize * dsetsize = tmp # <<<<<<<<<<<<<< @@ -43538,7 +42952,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":561 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":547 * dsetsize = tmp * * if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: # <<<<<<<<<<<<<< @@ -43555,12 +42969,12 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_3 = (((__pyx_t_5 / __pyx_t_6) > __pyx_v_dsetsize) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":562 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":548 * * if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: * free(result) # <<<<<<<<<<<<<< @@ -43569,7 +42983,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ free(__pyx_v_result); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":563 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":549 * if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: * free(result) * return self.merge_helper(low1, high1, arr1, step1, low2, high2, arr2, step2, offset_by_one, len_last, num_subpatterns, result_len) # <<<<<<<<<<<<<< @@ -43582,7 +42996,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":567 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":553 * # binary search. There are two flavors, depending on * # whether the queryset or dataset is first * if d_first: # <<<<<<<<<<<<<< @@ -43592,7 +43006,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = (__pyx_v_d_first != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":568 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":554 * # whether the queryset or dataset is first * if d_first: * med2 = median(low2, high2, step2) # <<<<<<<<<<<<<< @@ -43601,7 +43015,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_low2, __pyx_v_high2, __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":569 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":555 * if d_first: * med2 = median(low2, high2, step2) * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43610,7 +43024,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":571 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":557 * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) * * search_low = low1 # <<<<<<<<<<<<<< @@ -43619,7 +43033,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_search_low = __pyx_v_low1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":572 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":558 * * search_low = low1 * search_high = high1 # <<<<<<<<<<<<<< @@ -43628,7 +43042,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_search_high = __pyx_v_high1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":573 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":559 * search_low = low1 * search_high = high1 * while search_low < search_high: # <<<<<<<<<<<<<< @@ -43639,7 +43053,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_search_low < __pyx_v_search_high) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":574 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":560 * search_high = high1 * while search_low < search_high: * med1 = median(search_low, search_high, step1) # <<<<<<<<<<<<<< @@ -43648,7 +43062,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med1 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":575 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":561 * while search_low < search_high: * med1 = median(search_low, search_high, step1) * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<< @@ -43657,7 +43071,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":576 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":562 * med1 = median(search_low, search_high, step1) * 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) # <<<<<<<<<<<<<< @@ -43666,7 +43080,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":579 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":565 * if comparison == -1: * search_low = med1_plus * elif comparison == 1: # <<<<<<<<<<<<<< @@ -43675,7 +43089,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ switch (__pyx_v_comparison) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":577 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":563 * 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) * if comparison == -1: # <<<<<<<<<<<<<< @@ -43684,7 +43098,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ case -1: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":578 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":564 * comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) * if comparison == -1: * search_low = med1_plus # <<<<<<<<<<<<<< @@ -43694,7 +43108,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_v_search_low = __pyx_v_med1_plus; break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":579 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":565 * if comparison == -1: * search_low = med1_plus * elif comparison == 1: # <<<<<<<<<<<<<< @@ -43703,7 +43117,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ case 1: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":580 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":566 * search_low = med1_plus * elif comparison == 1: * search_high = med1_minus # <<<<<<<<<<<<<< @@ -43714,7 +43128,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( break; default: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":582 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":568 * search_high = med1_minus * else: * break # <<<<<<<<<<<<<< @@ -43730,7 +43144,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":584 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":570 * break * else: * med1 = median(low1, high1, step1) # <<<<<<<<<<<<<< @@ -43739,7 +43153,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med1 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_low1, __pyx_v_high1, __pyx_v_step1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":585 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":571 * else: * med1 = median(low1, high1, step1) * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<< @@ -43748,7 +43162,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":587 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":573 * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) * * search_low = low2 # <<<<<<<<<<<<<< @@ -43757,7 +43171,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_search_low = __pyx_v_low2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":588 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":574 * * search_low = low2 * search_high = high2 # <<<<<<<<<<<<<< @@ -43766,7 +43180,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_search_high = __pyx_v_high2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":589 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":575 * search_low = low2 * search_high = high2 * while search_low < search_high: # <<<<<<<<<<<<<< @@ -43777,7 +43191,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_search_low < __pyx_v_search_high) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":590 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":576 * search_high = high2 * while search_low < search_high: * med2 = median(search_low, search_high, step2) # <<<<<<<<<<<<<< @@ -43786,7 +43200,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":591 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":577 * while search_low < search_high: * med2 = median(search_low, search_high, step2) * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43795,7 +43209,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":592 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":578 * med2 = median(search_low, search_high, step2) * 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) # <<<<<<<<<<<<<< @@ -43804,7 +43218,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":595 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":581 * if comparison == -1: * search_high = med2 * elif comparison == 1: # <<<<<<<<<<<<<< @@ -43813,7 +43227,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ switch (__pyx_v_comparison) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":593 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":579 * 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) * if comparison == -1: # <<<<<<<<<<<<<< @@ -43822,7 +43236,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ case -1: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":594 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":580 * comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) * if comparison == -1: * search_high = med2 # <<<<<<<<<<<<<< @@ -43832,7 +43246,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_v_search_high = __pyx_v_med2; break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":595 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":581 * if comparison == -1: * search_high = med2 * elif comparison == 1: # <<<<<<<<<<<<<< @@ -43841,7 +43255,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ case 1: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":596 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":582 * search_high = med2 * elif comparison == 1: * search_low = med2 + step2 # <<<<<<<<<<<<<< @@ -43852,7 +43266,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( break; default: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":598 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":584 * search_low = med2 + step2 * else: * break # <<<<<<<<<<<<<< @@ -43867,7 +43281,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":600 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":586 * break * * med_result_len = 0 # <<<<<<<<<<<<<< @@ -43876,7 +43290,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med_result_len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":601 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":587 * * med_result_len = 0 * med_result = malloc(0*sizeof(int*)) # <<<<<<<<<<<<<< @@ -43885,7 +43299,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med_result = ((int *)malloc((0 * (sizeof(int *))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":602 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":588 * med_result_len = 0 * med_result = malloc(0*sizeof(int*)) * if search_high > search_low: # <<<<<<<<<<<<<< @@ -43895,7 +43309,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_search_high > __pyx_v_search_low) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":608 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":594 * # want to store the bindings for all of those elements. We can * # subsequently throw all of them away. * med2_minus = med2 # <<<<<<<<<<<<<< @@ -43904,7 +43318,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_minus = __pyx_v_med2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":609 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":595 * # subsequently throw all of them away. * med2_minus = med2 * med2_plus = med2 + step2 # <<<<<<<<<<<<<< @@ -43913,7 +43327,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_plus = (__pyx_v_med2 + __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":610 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":596 * med2_minus = med2 * med2_plus = med2 + step2 * i1 = med1_minus # <<<<<<<<<<<<<< @@ -43922,7 +43336,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_i1 = __pyx_v_med1_minus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":611 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":597 * med2_plus = med2 + step2 * i1 = med1_minus * while i1 < med1_plus: # <<<<<<<<<<<<<< @@ -43933,7 +43347,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_i1 < __pyx_v_med1_plus) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":612 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":598 * i1 = med1_minus * while i1 < med1_plus: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43942,7 +43356,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":613 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":599 * while i1 < med1_plus: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while med2_minus-step2 >= low2: # <<<<<<<<<<<<<< @@ -43953,7 +43367,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = (((__pyx_v_med2_minus - __pyx_v_step2) >= __pyx_v_low2) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":614 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":600 * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while med2_minus-step2 >= low2: * assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43962,7 +43376,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":615 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":601 * while med2_minus-step2 >= low2: * assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) < 1: # <<<<<<<<<<<<<< @@ -43972,7 +43386,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":616 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":602 * assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) < 1: * med2_minus = med2_minus - step2 # <<<<<<<<<<<<<< @@ -43984,7 +43398,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":618 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":604 * med2_minus = med2_minus - step2 * else: * break # <<<<<<<<<<<<<< @@ -43997,7 +43411,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L18_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":619 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":605 * else: * break * i2 = med2_minus # <<<<<<<<<<<<<< @@ -44006,7 +43420,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_i2 = __pyx_v_med2_minus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":620 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":606 * break * i2 = med2_minus * while i2 < high2: # <<<<<<<<<<<<<< @@ -44017,7 +43431,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_i2 < __pyx_v_high2) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":621 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":607 * i2 = med2_minus * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -44026,7 +43440,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":622 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":608 * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<< @@ -44035,7 +43449,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":623 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":609 * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) * if comparison == 0: # <<<<<<<<<<<<<< @@ -44045,7 +43459,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_comparison == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":625 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":611 * if comparison == 0: * pass * med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) # <<<<<<<<<<<<<< @@ -44057,7 +43471,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L22:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":626 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":612 * pass * med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) * if comparison == -1: # <<<<<<<<<<<<<< @@ -44067,7 +43481,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_comparison == -1) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":627 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":613 * med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) * if comparison == -1: * break # <<<<<<<<<<<<<< @@ -44079,7 +43493,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L23:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":628 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":614 * if comparison == -1: * break * i2 = i2 + step2 # <<<<<<<<<<<<<< @@ -44090,7 +43504,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L21_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":629 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":615 * break * i2 = i2 + step2 * if i2 > med2_plus: # <<<<<<<<<<<<<< @@ -44100,7 +43514,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_i2 > __pyx_v_med2_plus) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":630 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":616 * i2 = i2 + step2 * if i2 > med2_plus: * med2_plus = i2 # <<<<<<<<<<<<<< @@ -44112,7 +43526,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":631 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":617 * if i2 > med2_plus: * med2_plus = i2 * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -44122,7 +43536,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_v_i1 = (__pyx_v_i1 + __pyx_v_step1); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":633 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":619 * i1 = i1 + step1 * * tmp = med1_minus # <<<<<<<<<<<<<< @@ -44131,7 +43545,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_tmp = __pyx_v_med1_minus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":634 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":620 * * tmp = med1_minus * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -44140,7 +43554,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med1_minus = __pyx_v_med1_plus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":635 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":621 * tmp = med1_minus * med1_minus = med1_plus * med1_plus = tmp # <<<<<<<<<<<<<< @@ -44152,7 +43566,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":638 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":624 * else: * # No match; need to figure out the point of division in D and Q * med2_minus = med2 # <<<<<<<<<<<<<< @@ -44161,7 +43575,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_minus = __pyx_v_med2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":639 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":625 * # No match; need to figure out the point of division in D and Q * med2_minus = med2 * med2_plus = med2 # <<<<<<<<<<<<<< @@ -44170,7 +43584,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_plus = __pyx_v_med2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":640 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":626 * med2_minus = med2 * med2_plus = med2 * if d_first: # <<<<<<<<<<<<<< @@ -44180,7 +43594,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = (__pyx_v_d_first != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":641 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":627 * med2_plus = med2 * if d_first: * med2_minus = med2_minus + step2 # <<<<<<<<<<<<<< @@ -44189,7 +43603,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":642 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":628 * if d_first: * med2_minus = med2_minus + step2 * if comparison == -1: # <<<<<<<<<<<<<< @@ -44199,7 +43613,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_comparison == -1) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":643 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":629 * med2_minus = med2_minus + step2 * if comparison == -1: * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -44211,7 +43625,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L26:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":644 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":630 * if comparison == -1: * med1_minus = med1_plus * if comparison == 1: # <<<<<<<<<<<<<< @@ -44221,7 +43635,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_comparison == 1) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":645 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":631 * med1_minus = med1_plus * if comparison == 1: * med1_plus = med1_minus # <<<<<<<<<<<<<< @@ -44236,7 +43650,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":647 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":633 * med1_plus = med1_minus * else: * tmp = med1_minus # <<<<<<<<<<<<<< @@ -44245,7 +43659,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_tmp = __pyx_v_med1_minus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":648 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":634 * else: * tmp = med1_minus * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -44254,7 +43668,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med1_minus = __pyx_v_med1_plus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":649 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":635 * tmp = med1_minus * med1_minus = med1_plus * med1_plus = tmp # <<<<<<<<<<<<<< @@ -44263,7 +43677,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med1_plus = __pyx_v_tmp; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":650 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":636 * med1_minus = med1_plus * med1_plus = tmp * if comparison == 1: # <<<<<<<<<<<<<< @@ -44273,7 +43687,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_comparison == 1) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":651 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":637 * med1_plus = tmp * if comparison == 1: * med2_minus = med2_minus + step2 # <<<<<<<<<<<<<< @@ -44282,7 +43696,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":652 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":638 * if comparison == 1: * med2_minus = med2_minus + step2 * med2_plus = med2_plus + step2 # <<<<<<<<<<<<<< @@ -44298,7 +43712,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L14:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":654 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":640 * med2_plus = med2_plus + step2 * * low_result_len = 0 # <<<<<<<<<<<<<< @@ -44307,7 +43721,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_low_result_len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":655 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":641 * * low_result_len = 0 * low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len) # <<<<<<<<<<<<<< @@ -44316,7 +43730,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_low_result = ((struct __pyx_vtabstruct_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":656 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":642 * low_result_len = 0 * low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len) * high_result_len = 0 # <<<<<<<<<<<<<< @@ -44325,7 +43739,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_high_result_len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":657 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":643 * low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len) * 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) # <<<<<<<<<<<<<< @@ -44334,7 +43748,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_high_result = ((struct __pyx_vtabstruct_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":659 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":645 * 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) * * result = extend_arr(result, result_len, low_result, low_result_len) # <<<<<<<<<<<<<< @@ -44343,7 +43757,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_low_result, __pyx_v_low_result_len); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":660 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":646 * * result = extend_arr(result, result_len, low_result, low_result_len) * result = extend_arr(result, result_len, med_result, med_result_len) # <<<<<<<<<<<<<< @@ -44352,7 +43766,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_med_result, __pyx_v_med_result_len); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":661 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":647 * result = extend_arr(result, result_len, low_result, low_result_len) * result = extend_arr(result, result_len, med_result, med_result_len) * result = extend_arr(result, result_len, high_result, high_result_len) # <<<<<<<<<<<<<< @@ -44361,7 +43775,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_high_result, __pyx_v_high_result_len); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":662 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":648 * result = extend_arr(result, result_len, med_result, med_result_len) * result = extend_arr(result, result_len, high_result, high_result_len) * free(low_result) # <<<<<<<<<<<<<< @@ -44370,7 +43784,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ free(__pyx_v_low_result); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":663 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":649 * result = extend_arr(result, result_len, high_result, high_result_len) * free(low_result) * free(med_result) # <<<<<<<<<<<<<< @@ -44379,7 +43793,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ free(__pyx_v_med_result); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":664 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":650 * free(low_result) * free(med_result) * free(high_result) # <<<<<<<<<<<<<< @@ -44388,7 +43802,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ free(__pyx_v_high_result); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":666 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":652 * free(high_result) * * return result # <<<<<<<<<<<<<< @@ -44408,7 +43822,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":670 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":656 * * * cdef long compare_matchings_set(self, int i1_minus, int i1_plus, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -44427,7 +43841,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s int __pyx_t_1; __Pyx_RefNannySetupContext("compare_matchings_set", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":681 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":667 * cdef Matching* loc1 * * loc1 = &l1_stack # <<<<<<<<<<<<<< @@ -44436,7 +43850,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_v_loc1 = (&__pyx_v_l1_stack); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":683 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":669 * loc1 = &l1_stack * * i1 = i1_minus # <<<<<<<<<<<<<< @@ -44445,7 +43859,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_v_i1 = __pyx_v_i1_minus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":684 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":670 * * i1 = i1_minus * while i1 < i1_plus: # <<<<<<<<<<<<<< @@ -44456,7 +43870,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s __pyx_t_1 = ((__pyx_v_i1 < __pyx_v_i1_plus) != 0); if (!__pyx_t_1) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":685 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":671 * i1 = i1_minus * while i1 < i1_plus: * assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -44465,7 +43879,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_f_4cdec_2sa_3_sa_assign_matching(__pyx_v_loc1, __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":686 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":672 * while i1 < i1_plus: * assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) * comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) # <<<<<<<<<<<<<< @@ -44474,7 +43888,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":687 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":673 * assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) * comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) * if comparison == 0: # <<<<<<<<<<<<<< @@ -44484,7 +43898,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s __pyx_t_1 = ((__pyx_v_comparison == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":688 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":674 * comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) * if comparison == 0: * prev_comparison = 0 # <<<<<<<<<<<<<< @@ -44493,7 +43907,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_v_prev_comparison = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":689 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":675 * if comparison == 0: * prev_comparison = 0 * break # <<<<<<<<<<<<<< @@ -44504,7 +43918,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s goto __pyx_L5; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":690 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":676 * prev_comparison = 0 * break * elif i1 == i1_minus: # <<<<<<<<<<<<<< @@ -44514,7 +43928,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s __pyx_t_1 = ((__pyx_v_i1 == __pyx_v_i1_minus) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":691 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":677 * break * elif i1 == i1_minus: * prev_comparison = comparison # <<<<<<<<<<<<<< @@ -44526,7 +43940,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":693 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":679 * prev_comparison = comparison * else: * if comparison != prev_comparison: # <<<<<<<<<<<<<< @@ -44536,7 +43950,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s __pyx_t_1 = ((__pyx_v_comparison != __pyx_v_prev_comparison) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":694 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":680 * else: * if comparison != prev_comparison: * prev_comparison = 0 # <<<<<<<<<<<<<< @@ -44545,7 +43959,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_v_prev_comparison = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":695 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":681 * if comparison != prev_comparison: * prev_comparison = 0 * break # <<<<<<<<<<<<<< @@ -44559,7 +43973,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":696 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":682 * prev_comparison = 0 * break * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -44570,7 +43984,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s } __pyx_L4_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":697 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":683 * break * i1 = i1 + step1 * return prev_comparison # <<<<<<<<<<<<<< @@ -44586,7 +44000,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":700 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":686 * * * cdef long compare_matchings(self, Matching* loc1, Matching* loc2, int offset_by_one, int len_last): # <<<<<<<<<<<<<< @@ -44604,7 +44018,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s int __pyx_t_4; __Pyx_RefNannySetupContext("compare_matchings", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":703 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":689 * cdef int i * * if loc1.sent_id > loc2.sent_id: # <<<<<<<<<<<<<< @@ -44614,7 +44028,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_1 = ((__pyx_v_loc1->sent_id > __pyx_v_loc2->sent_id) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":704 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":690 * * if loc1.sent_id > loc2.sent_id: * return 1 # <<<<<<<<<<<<<< @@ -44627,7 +44041,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":705 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":691 * if loc1.sent_id > loc2.sent_id: * return 1 * if loc2.sent_id > loc1.sent_id: # <<<<<<<<<<<<<< @@ -44637,7 +44051,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_1 = ((__pyx_v_loc2->sent_id > __pyx_v_loc1->sent_id) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":706 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":692 * return 1 * if loc2.sent_id > loc1.sent_id: * return -1 # <<<<<<<<<<<<<< @@ -44650,7 +44064,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":708 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":694 * return -1 * * if loc1.size == 1 and loc2.size == 1: # <<<<<<<<<<<<<< @@ -44666,7 +44080,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":709 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":695 * * if loc1.size == 1 and loc2.size == 1: * if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size: # <<<<<<<<<<<<<< @@ -44676,7 +44090,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = ((((__pyx_v_loc2->arr[__pyx_v_loc2->start]) - (__pyx_v_loc1->arr[__pyx_v_loc1->start])) <= __pyx_v_self->train_min_gap_size) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":710 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":696 * if loc1.size == 1 and loc2.size == 1: * if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size: * return 1 # <<<<<<<<<<<<<< @@ -44691,7 +44105,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s goto __pyx_L5; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":712 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":698 * return 1 * * elif offset_by_one: # <<<<<<<<<<<<<< @@ -44701,7 +44115,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (__pyx_v_offset_by_one != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":713 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":699 * * elif offset_by_one: * for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -44711,7 +44125,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_4 = __pyx_v_loc1->size; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":714 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":700 * elif offset_by_one: * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<< @@ -44721,7 +44135,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) > (__pyx_v_loc2->arr[((__pyx_v_loc2->start + __pyx_v_i) - 1)])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":715 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":701 * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: * return 1 # <<<<<<<<<<<<<< @@ -44734,7 +44148,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":716 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":702 * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<< @@ -44744,7 +44158,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) < (__pyx_v_loc2->arr[((__pyx_v_loc2->start + __pyx_v_i) - 1)])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":717 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":703 * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]: * return -1 # <<<<<<<<<<<<<< @@ -44761,7 +44175,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":720 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":706 * * else: * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: # <<<<<<<<<<<<<< @@ -44771,7 +44185,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = ((((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) > (__pyx_v_loc2->arr[__pyx_v_loc2->start])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":721 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":707 * else: * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: * return 1 # <<<<<<<<<<<<<< @@ -44784,7 +44198,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } __pyx_L11:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":722 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":708 * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: * return 1 * if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: # <<<<<<<<<<<<<< @@ -44794,7 +44208,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = ((((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) < (__pyx_v_loc2->arr[__pyx_v_loc2->start])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":723 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":709 * return 1 * if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: * return -1 # <<<<<<<<<<<<<< @@ -44807,7 +44221,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } __pyx_L12:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":725 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":711 * return -1 * * for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -44817,7 +44231,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_4 = __pyx_v_loc1->size; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":726 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":712 * * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<< @@ -44827,7 +44241,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) > (__pyx_v_loc2->arr[(__pyx_v_loc2->start + __pyx_v_i)])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":727 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":713 * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: * return 1 # <<<<<<<<<<<<<< @@ -44840,7 +44254,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } __pyx_L15:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":728 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":714 * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<< @@ -44850,7 +44264,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) < (__pyx_v_loc2->arr[(__pyx_v_loc2->start + __pyx_v_i)])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":729 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":715 * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: * return -1 # <<<<<<<<<<<<<< @@ -44866,7 +44280,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":731 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":717 * return -1 * * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -44876,7 +44290,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (((((__pyx_v_loc2->arr[(__pyx_v_loc2->end - 1)]) + __pyx_v_len_last) - (__pyx_v_loc1->arr[__pyx_v_loc1->start])) > __pyx_v_self->train_max_initial_size) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":732 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":718 * * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: * return -1 # <<<<<<<<<<<<<< @@ -44889,7 +44303,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } __pyx_L17:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":733 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":719 * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: * return -1 * return 0 # <<<<<<<<<<<<<< @@ -44905,7 +44319,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":736 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":722 * * * cdef int* merge_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -44929,7 +44343,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct int __pyx_t_3; __Pyx_RefNannySetupContext("merge_helper", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":744 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":730 * cdef Matching loc1, loc2 * * result_len[0] = 0 # <<<<<<<<<<<<<< @@ -44938,7 +44352,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ (__pyx_v_result_len[0]) = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":745 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":731 * * result_len[0] = 0 * result = malloc(0*sizeof(int)) # <<<<<<<<<<<<<< @@ -44947,7 +44361,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_result = ((int *)malloc((0 * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":747 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":733 * result = malloc(0*sizeof(int)) * * i1 = low1 # <<<<<<<<<<<<<< @@ -44956,7 +44370,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_i1 = __pyx_v_low1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":748 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":734 * * i1 = low1 * i2 = low2 # <<<<<<<<<<<<<< @@ -44965,7 +44379,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_i2 = __pyx_v_low2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":749 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":735 * i1 = low1 * i2 = low2 * while i1 < high1 and i2 < high2: # <<<<<<<<<<<<<< @@ -44982,7 +44396,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":752 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":738 * * # First, pop all unneeded loc2's off the stack * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -44991,7 +44405,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":753 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":739 * # First, pop all unneeded loc2's off the stack * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while i2 < high2: # <<<<<<<<<<<<<< @@ -45002,7 +44416,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_t_3 = ((__pyx_v_i2 < __pyx_v_high2) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":754 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":740 * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -45011,7 +44425,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":755 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":741 * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: # <<<<<<<<<<<<<< @@ -45021,7 +44435,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":756 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":742 * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: * i2 = i2 + step2 # <<<<<<<<<<<<<< @@ -45033,7 +44447,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":758 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":744 * i2 = i2 + step2 * else: * break # <<<<<<<<<<<<<< @@ -45046,7 +44460,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } __pyx_L6_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":761 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":747 * * # Next: process all loc1's with the same starting val * j1 = i1 # <<<<<<<<<<<<<< @@ -45055,7 +44469,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_j1 = __pyx_v_i1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":762 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":748 * # Next: process all loc1's with the same starting val * j1 = i1 * while i1 < high1 and arr1[j1] == arr1[i1]: # <<<<<<<<<<<<<< @@ -45072,7 +44486,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":763 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":749 * j1 = i1 * while i1 < high1 and arr1[j1] == arr1[i1]: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -45081,7 +44495,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":764 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":750 * while i1 < high1 and arr1[j1] == arr1[i1]: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * j2 = i2 # <<<<<<<<<<<<<< @@ -45090,7 +44504,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_j2 = __pyx_v_i2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":765 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":751 * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * j2 = i2 * while j2 < high2: # <<<<<<<<<<<<<< @@ -45101,7 +44515,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_t_2 = ((__pyx_v_j2 < __pyx_v_high2) != 0); if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":766 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":752 * j2 = i2 * while j2 < high2: * assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -45110,7 +44524,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_j2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":767 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":753 * while j2 < high2: * assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<< @@ -45119,7 +44533,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":768 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":754 * assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) * if comparison == 0: # <<<<<<<<<<<<<< @@ -45129,7 +44543,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_t_2 = ((__pyx_v_comparison == 0) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":769 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":755 * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) * if comparison == 0: * result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len) # <<<<<<<<<<<<<< @@ -45141,7 +44555,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } __pyx_L12:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":770 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":756 * if comparison == 0: * result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len) * if comparison == 1: # <<<<<<<<<<<<<< @@ -45154,7 +44568,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } __pyx_L13:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":772 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":758 * if comparison == 1: * pass * if comparison == -1: # <<<<<<<<<<<<<< @@ -45164,7 +44578,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_t_2 = ((__pyx_v_comparison == -1) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":773 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":759 * pass * if comparison == -1: * break # <<<<<<<<<<<<<< @@ -45176,7 +44590,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":775 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":761 * break * else: * j2 = j2 + step2 # <<<<<<<<<<<<<< @@ -45189,7 +44603,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } __pyx_L11_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":776 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":762 * else: * j2 = j2 + step2 * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -45200,7 +44614,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":777 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":763 * j2 = j2 + step2 * i1 = i1 + step1 * return result # <<<<<<<<<<<<<< @@ -45216,7 +44630,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":780 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":766 * * * cdef void sort_phrase_loc(self, IntList arr, PhraseLocation loc, Phrase phrase): # <<<<<<<<<<<<<< @@ -45239,27 +44653,27 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sort_phrase_loc", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":785 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":771 * cdef IntList result * * if phrase in self.precomputed_index: # <<<<<<<<<<<<<< * loc.arr = self.precomputed_index[phrase] * else: */ - __pyx_t_1 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_phrase), __pyx_v_self->precomputed_index, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_phrase), __pyx_v_self->precomputed_index, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":786 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":772 * * if phrase in self.precomputed_index: * loc.arr = self.precomputed_index[phrase] # <<<<<<<<<<<<<< * else: * loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __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_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_loc->arr); __Pyx_DECREF(((PyObject *)__pyx_v_loc->arr)); @@ -45269,20 +44683,20 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":788 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":774 * loc.arr = self.precomputed_index[phrase] * else: * loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) # <<<<<<<<<<<<<< * veb = VEB(arr.len) * for i from loc.sa_low <= i < loc.sa_high: */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_4); @@ -45291,27 +44705,27 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str __pyx_v_loc->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":789 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":775 * else: * loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) * veb = VEB(arr.len) # <<<<<<<<<<<<<< * for i from loc.sa_low <= i < loc.sa_high: * veb._insert(arr.arr[i]) */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 775; __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[8]; __pyx_lineno = 789; __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 = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_VEB)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_VEB)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_v_veb = ((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":790 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":776 * loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) * veb = VEB(arr.len) * for i from loc.sa_low <= i < loc.sa_high: # <<<<<<<<<<<<<< @@ -45321,7 +44735,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str __pyx_t_5 = __pyx_v_loc->sa_high; for (__pyx_v_i = __pyx_v_loc->sa_low; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":791 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":777 * veb = VEB(arr.len) * for i from loc.sa_low <= i < loc.sa_high: * veb._insert(arr.arr[i]) # <<<<<<<<<<<<<< @@ -45331,7 +44745,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_insert(__pyx_v_veb, (__pyx_v_arr->arr[__pyx_v_i])); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":792 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":778 * for i from loc.sa_low <= i < loc.sa_high: * veb._insert(arr.arr[i]) * i = veb.veb.min_val # <<<<<<<<<<<<<< @@ -45341,7 +44755,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str __pyx_t_5 = __pyx_v_veb->veb->min_val; __pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":793 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":779 * veb._insert(arr.arr[i]) * i = veb.veb.min_val * for j from 0 <= j < loc.sa_high-loc.sa_low: # <<<<<<<<<<<<<< @@ -45351,7 +44765,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str __pyx_t_5 = (__pyx_v_loc->sa_high - __pyx_v_loc->sa_low); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":794 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":780 * i = veb.veb.min_val * for j from 0 <= j < loc.sa_high-loc.sa_low: * loc.arr.arr[j] = i # <<<<<<<<<<<<<< @@ -45360,7 +44774,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str */ (__pyx_v_loc->arr->arr[__pyx_v_j]) = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":795 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":781 * for j from 0 <= j < loc.sa_high-loc.sa_low: * loc.arr.arr[j] = i * i = veb._findsucc(i) # <<<<<<<<<<<<<< @@ -45372,7 +44786,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":796 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":782 * loc.arr.arr[j] = i * i = veb._findsucc(i) * loc.arr_low = 0 # <<<<<<<<<<<<<< @@ -45381,7 +44795,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str */ __pyx_v_loc->arr_low = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":797 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":783 * i = veb._findsucc(i) * loc.arr_low = 0 * loc.arr_high = loc.arr.len # <<<<<<<<<<<<<< @@ -45401,7 +44815,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":800 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":786 * * * cdef intersect_helper(self, Phrase prefix, Phrase suffix, # <<<<<<<<<<<<<< @@ -45438,7 +44852,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help int __pyx_clineno = 0; __Pyx_RefNannySetupContext("intersect_helper", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":807 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":793 * cdef int* result_ptr * * result_len = 0 # <<<<<<<<<<<<<< @@ -45447,21 +44861,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ __pyx_v_result_len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":809 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":795 * result_len = 0 * * if sym_isvar(suffix[0]): # <<<<<<<<<<<<<< * offset_by_one = 1 * else: */ - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __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 = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_2) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":810 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":796 * * if sym_isvar(suffix[0]): * offset_by_one = 1 # <<<<<<<<<<<<<< @@ -45473,7 +44887,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":812 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":798 * offset_by_one = 1 * else: * offset_by_one = 0 # <<<<<<<<<<<<<< @@ -45484,34 +44898,34 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":814 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":800 * offset_by_one = 0 * * len_last = len(suffix.getchunk(suffix.arity())) # <<<<<<<<<<<<<< * * if prefix_loc.arr is None: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __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 = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 800; __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 = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __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 = 814; __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[8]; __pyx_lineno = 800; __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; - __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_len_last = __pyx_t_6; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":816 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":802 * len_last = len(suffix.getchunk(suffix.arity())) * * if prefix_loc.arr is None: # <<<<<<<<<<<<<< @@ -45522,7 +44936,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_7 = (__pyx_t_3 != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":817 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":803 * * if prefix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) # <<<<<<<<<<<<<< @@ -45537,7 +44951,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":818 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":804 * if prefix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) * arr1 = prefix_loc.arr # <<<<<<<<<<<<<< @@ -45549,7 +44963,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_v_arr1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":819 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":805 * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) * arr1 = prefix_loc.arr * low1 = prefix_loc.arr_low # <<<<<<<<<<<<<< @@ -45559,7 +44973,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_prefix_loc->arr_low; __pyx_v_low1 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":820 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":806 * arr1 = prefix_loc.arr * low1 = prefix_loc.arr_low * high1 = prefix_loc.arr_high # <<<<<<<<<<<<<< @@ -45569,7 +44983,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_prefix_loc->arr_high; __pyx_v_high1 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":821 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":807 * low1 = prefix_loc.arr_low * high1 = prefix_loc.arr_high * step1 = prefix_loc.num_subpatterns # <<<<<<<<<<<<<< @@ -45579,7 +44993,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_prefix_loc->num_subpatterns; __pyx_v_step1 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":823 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":809 * step1 = prefix_loc.num_subpatterns * * if suffix_loc.arr is None: # <<<<<<<<<<<<<< @@ -45590,7 +45004,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_3 = (__pyx_t_7 != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":824 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":810 * * if suffix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) # <<<<<<<<<<<<<< @@ -45605,7 +45019,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":825 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":811 * if suffix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) * arr2 = suffix_loc.arr # <<<<<<<<<<<<<< @@ -45617,7 +45031,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_v_arr2 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":826 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":812 * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) * arr2 = suffix_loc.arr * low2 = suffix_loc.arr_low # <<<<<<<<<<<<<< @@ -45627,7 +45041,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_suffix_loc->arr_low; __pyx_v_low2 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":827 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":813 * arr2 = suffix_loc.arr * low2 = suffix_loc.arr_low * high2 = suffix_loc.arr_high # <<<<<<<<<<<<<< @@ -45637,7 +45051,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_suffix_loc->arr_high; __pyx_v_high2 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":828 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":814 * low2 = suffix_loc.arr_low * high2 = suffix_loc.arr_high * step2 = suffix_loc.num_subpatterns # <<<<<<<<<<<<<< @@ -45647,26 +45061,26 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_suffix_loc->num_subpatterns; __pyx_v_step2 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":830 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":816 * step2 = suffix_loc.num_subpatterns * * num_subpatterns = prefix.arity()+1 # <<<<<<<<<<<<<< * * if algorithm == MERGE: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 816; __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 = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 816; __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 = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_num_subpatterns = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":832 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":818 * num_subpatterns = prefix.arity()+1 * * if algorithm == MERGE: # <<<<<<<<<<<<<< @@ -45676,7 +45090,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_3 = ((__pyx_v_algorithm == __pyx_v_4cdec_2sa_3_sa_MERGE) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":835 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":821 * result_ptr = self.merge_helper(low1, high1, arr1.arr, step1, * low2, high2, arr2.arr, step2, * offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<< @@ -45688,7 +45102,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":839 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":825 * result_ptr = self.baeza_yates_helper(low1, high1, arr1.arr, step1, * low2, high2, arr2.arr, step2, * offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<< @@ -45699,7 +45113,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":841 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":827 * offset_by_one, len_last, num_subpatterns, &result_len) * * if result_len == 0: # <<<<<<<<<<<<<< @@ -45709,7 +45123,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_3 = ((__pyx_v_result_len == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":842 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":828 * * if result_len == 0: * free(result_ptr) # <<<<<<<<<<<<<< @@ -45718,7 +45132,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ free(__pyx_v_result_ptr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":843 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":829 * if result_len == 0: * free(result_ptr) * return None # <<<<<<<<<<<<<< @@ -45733,19 +45147,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":845 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":831 * return None * else: * result = IntList() # <<<<<<<<<<<<<< * free(result.arr) * result.arr = result_ptr */ - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_v_result = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":846 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":832 * else: * result = IntList() * free(result.arr) # <<<<<<<<<<<<<< @@ -45754,7 +45168,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ free(__pyx_v_result->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":847 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":833 * result = IntList() * free(result.arr) * result.arr = result_ptr # <<<<<<<<<<<<<< @@ -45763,7 +45177,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ __pyx_v_result->arr = __pyx_v_result_ptr; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":848 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":834 * free(result.arr) * result.arr = result_ptr * result.len = result_len # <<<<<<<<<<<<<< @@ -45772,7 +45186,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ __pyx_v_result->len = __pyx_v_result_len; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":849 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":835 * result.arr = result_ptr * result.len = result_len * result.size = result_len # <<<<<<<<<<<<<< @@ -45781,7 +45195,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ __pyx_v_result->size = __pyx_v_result_len; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":850 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":836 * result.len = result_len * result.size = result_len * return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) # <<<<<<<<<<<<<< @@ -45789,19 +45203,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help * cdef loc2str(self, PhraseLocation loc): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __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 = 850; __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 = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __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 = 836; __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 = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __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 = 850; __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 = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr), ((PyObject *)__pyx_v_result)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __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 = 836; __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 = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __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_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __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; @@ -45827,7 +45241,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":852 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":838 * return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) * * cdef loc2str(self, PhraseLocation loc): # <<<<<<<<<<<<<< @@ -45850,7 +45264,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON int __pyx_clineno = 0; __Pyx_RefNannySetupContext("loc2str", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":854 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":840 * cdef loc2str(self, PhraseLocation loc): * cdef int i, j * result = "{" # <<<<<<<<<<<<<< @@ -45860,7 +45274,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON __Pyx_INCREF(((PyObject *)__pyx_kp_s_120)); __pyx_v_result = ((PyObject *)__pyx_kp_s_120); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":855 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":841 * cdef int i, j * result = "{" * i = 0 # <<<<<<<<<<<<<< @@ -45869,7 +45283,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON */ __pyx_v_i = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":856 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":842 * result = "{" * i = 0 * while i < loc.arr_high: # <<<<<<<<<<<<<< @@ -45880,19 +45294,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON __pyx_t_1 = ((__pyx_v_i < __pyx_v_loc->arr_high) != 0); if (!__pyx_t_1) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":857 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":843 * i = 0 * while i < loc.arr_high: * result = result + "(" # <<<<<<<<<<<<<< * for j from i <= j < i + loc.num_subpatterns: * result = result + ("%d " %loc.arr[j]) */ - __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_121)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_121)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":858 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":844 * while i < loc.arr_high: * result = result + "(" * for j from i <= j < i + loc.num_subpatterns: # <<<<<<<<<<<<<< @@ -45902,38 +45316,38 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON __pyx_t_3 = (__pyx_v_i + __pyx_v_loc->num_subpatterns); for (__pyx_v_j = __pyx_v_i; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":859 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":845 * result = result + "(" * for j from i <= j < i + loc.num_subpatterns: * result = result + ("%d " %loc.arr[j]) # <<<<<<<<<<<<<< * result = result + ")" * i = i + loc.num_subpatterns */ - __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_loc->arr), __pyx_v_j, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_loc->arr), __pyx_v_j, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":860 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":846 * for j from i <= j < i + loc.num_subpatterns: * result = result + ("%d " %loc.arr[j]) * result = result + ")" # <<<<<<<<<<<<<< * i = i + loc.num_subpatterns * result = result + "}" */ - __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":861 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":847 * result = result + ("%d " %loc.arr[j]) * result = result + ")" * i = i + loc.num_subpatterns # <<<<<<<<<<<<<< @@ -45943,19 +45357,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON __pyx_v_i = (__pyx_v_i + __pyx_v_loc->num_subpatterns); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":862 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":848 * result = result + ")" * i = i + loc.num_subpatterns * result = result + "}" # <<<<<<<<<<<<<< * return result * */ - __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_122)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_122)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":863 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":849 * i = i + loc.num_subpatterns * result = result + "}" * return result # <<<<<<<<<<<<<< @@ -45981,7 +45395,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":865 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":851 * return result * * cdef PhraseLocation intersect(self, prefix_node, suffix_node, Phrase phrase): # <<<<<<<<<<<<<< @@ -46008,81 +45422,81 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("intersect", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":869 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":855 * cdef PhraseLocation prefix_loc, suffix_loc, result * * prefix = prefix_node.phrase # <<<<<<<<<<<<<< * suffix = suffix_node.phrase * prefix_loc = prefix_node.phrase_location */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 855; __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_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_prefix = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":870 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":856 * * prefix = prefix_node.phrase * suffix = suffix_node.phrase # <<<<<<<<<<<<<< * prefix_loc = prefix_node.phrase_location * suffix_loc = suffix_node.phrase_location */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 856; __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_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_suffix = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":871 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":857 * prefix = prefix_node.phrase * suffix = suffix_node.phrase * prefix_loc = prefix_node.phrase_location # <<<<<<<<<<<<<< * suffix_loc = suffix_node.phrase_location * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 857; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_prefix_loc = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":872 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":858 * suffix = suffix_node.phrase * prefix_loc = prefix_node.phrase_location * suffix_loc = suffix_node.phrase_location # <<<<<<<<<<<<<< * * result = self.get_precomputed_collocation(phrase) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 858; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_suffix_loc = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":874 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":860 * suffix_loc = suffix_node.phrase_location * * result = self.get_precomputed_collocation(phrase) # <<<<<<<<<<<<<< * if result is not None: * intersect_method = "precomputed" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __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 = 874; __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 = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_phrase)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_phrase)); __Pyx_GIVEREF(((PyObject *)__pyx_v_phrase)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __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[8]; __pyx_lineno = 860; __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; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_result = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":875 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":861 * * result = self.get_precomputed_collocation(phrase) * if result is not None: # <<<<<<<<<<<<<< @@ -46093,7 +45507,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":876 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":862 * result = self.get_precomputed_collocation(phrase) * if result is not None: * intersect_method = "precomputed" # <<<<<<<<<<<<<< @@ -46106,7 +45520,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":878 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":864 * intersect_method = "precomputed" * * if result is None: # <<<<<<<<<<<<<< @@ -46117,7 +45531,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":879 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":865 * * if result is None: * if self.use_baeza_yates: # <<<<<<<<<<<<<< @@ -46127,20 +45541,20 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 __pyx_t_4 = (__pyx_v_self->use_baeza_yates != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":880 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":866 * if result is None: * if self.use_baeza_yates: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES) # <<<<<<<<<<<<<< * intersect_method="double binary" * else: */ - __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_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_4cdec_2sa_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_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_4cdec_2sa_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_result, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":881 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":867 * if self.use_baeza_yates: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES) * intersect_method="double binary" # <<<<<<<<<<<<<< @@ -46153,20 +45567,20 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":883 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":869 * intersect_method="double binary" * else: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) # <<<<<<<<<<<<<< * intersect_method="merge" * return result */ - __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_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_4cdec_2sa_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_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_4cdec_2sa_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_result, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":884 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":870 * else: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) * intersect_method="merge" # <<<<<<<<<<<<<< @@ -46181,7 +45595,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":885 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":871 * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) * intersect_method="merge" * return result # <<<<<<<<<<<<<< @@ -46246,16 +45660,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyO case 1: 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 = 887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: 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 = 887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "advance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "advance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -46270,7 +45684,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -46281,7 +45695,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyO return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":887 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":873 * return result * * def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<< @@ -46322,19 +45736,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("advance", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":889 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":875 * def advance(self, frontier, res, fwords): * cdef unsigned na * nf = [] # <<<<<<<<<<<<<< * for toskip, (i, alt, pathlen) in frontier: * spanlen = fwords[i][alt][2] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __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 = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_nf = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":890 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":876 * cdef unsigned na * nf = [] * for toskip, (i, alt, pathlen) in frontier: # <<<<<<<<<<<<<< @@ -46345,7 +45759,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __pyx_t_1 = __pyx_v_frontier; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_frontier); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_frontier); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -46353,23 +45767,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -46385,7 +45799,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -46398,16 +45812,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } 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 = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -46415,7 +45829,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __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[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __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; @@ -46423,7 +45837,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_toskip, __pyx_t_5); @@ -46438,7 +45852,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -46454,18 +45868,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } 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 = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext; @@ -46475,7 +45889,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_GOTREF(__pyx_t_9); 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 = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __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; @@ -46483,7 +45897,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7); @@ -46493,44 +45907,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_XDECREF_SET(__pyx_v_pathlen, __pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":891 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":877 * nf = [] * for toskip, (i, alt, pathlen) in frontier: * spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<< * if toskip == 0: * res.append((i, alt, pathlen)) */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_spanlen, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":892 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":878 * for toskip, (i, alt, pathlen) in frontier: * spanlen = fwords[i][alt][2] * if toskip == 0: # <<<<<<<<<<<<<< * res.append((i, alt, pathlen)) * ni = i + spanlen */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_toskip, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_toskip, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":893 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":879 * spanlen = fwords[i][alt][2] * if toskip == 0: * res.append((i, alt, pathlen)) # <<<<<<<<<<<<<< * ni = i + spanlen * if ni < len(fwords) and pathlen + 1 < self.max_initial_size: */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_i); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_i); @@ -46541,7 +45955,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_INCREF(__pyx_v_pathlen); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_pathlen); __Pyx_GIVEREF(__pyx_v_pathlen); - __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_res, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_res, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -46549,41 +45963,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":894 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":880 * if toskip == 0: * res.append((i, alt, pathlen)) * ni = i + spanlen # <<<<<<<<<<<<<< * if ni < len(fwords) and pathlen + 1 < self.max_initial_size: * for na in range(len(fwords[ni])): */ - __pyx_t_6 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_ni, __pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":895 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":881 * res.append((i, alt, pathlen)) * ni = i + spanlen * if ni < len(fwords) and pathlen + 1 < self.max_initial_size: # <<<<<<<<<<<<<< * for na in range(len(fwords[ni])): * nf.append((toskip - 1, (ni, na, pathlen + 1))) */ - __pyx_t_13 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_ni, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_ni, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { - __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_15 = __pyx_t_14; } else { @@ -46591,34 +46005,34 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str } if (__pyx_t_15) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":896 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":882 * ni = i + spanlen * if ni < len(fwords) and pathlen + 1 < self.max_initial_size: * for na in range(len(fwords[ni])): # <<<<<<<<<<<<<< * nf.append((toskip - 1, (ni, na, pathlen + 1))) * if len(nf) > 0: */ - __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ni); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ni); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_13 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_13; __pyx_t_16+=1) { __pyx_v_na = __pyx_t_16; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":897 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":883 * if ni < len(fwords) and pathlen + 1 < self.max_initial_size: * for na in range(len(fwords[ni])): * nf.append((toskip - 1, (ni, na, pathlen + 1))) # <<<<<<<<<<<<<< * if len(nf) > 0: * return self.advance(nf, res, fwords) */ - __pyx_t_5 = PyNumber_Subtract(__pyx_v_toskip, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_toskip, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_na); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_na); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_ni); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_ni); @@ -46629,7 +46043,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_GIVEREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __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); @@ -46637,7 +46051,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); __pyx_t_5 = 0; __pyx_t_10 = 0; - __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; } goto __pyx_L10; @@ -46646,18 +46060,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":898 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":884 * for na in range(len(fwords[ni])): * nf.append((toskip - 1, (ni, na, pathlen + 1))) * if len(nf) > 0: # <<<<<<<<<<<<<< * return self.advance(nf, res, fwords) * else: */ - __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = ((__pyx_t_2 > 0) != 0); if (__pyx_t_15) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":899 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":885 * nf.append((toskip - 1, (ni, na, pathlen + 1))) * if len(nf) > 0: * return self.advance(nf, res, fwords) # <<<<<<<<<<<<<< @@ -46665,9 +46079,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str * return res */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_nf)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_nf)); @@ -46678,7 +46092,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_INCREF(__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_fwords); __Pyx_GIVEREF(__pyx_v_fwords); - __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __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_4)); __pyx_t_4 = 0; @@ -46689,7 +46103,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":901 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":887 * return self.advance(nf, res, fwords) * else: * return res # <<<<<<<<<<<<<< @@ -46770,36 +46184,36 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nod case 1: 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 = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: 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 = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: 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 = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: 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 = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: 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 = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: 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 = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_nodes_isteps_away") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_nodes_isteps_away") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -46822,7 +46236,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nod } goto __pyx_L4_argument_unpacking_done; __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 = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_all_nodes_isteps_away", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -46833,7 +46247,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nod return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":903 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":889 * return res * * def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<< @@ -46872,41 +46286,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_all_nodes_isteps_away", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":905 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":891 * def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): * cdef unsigned alt_it * frontier = [] # <<<<<<<<<<<<<< * if i+spanlen+skip >= len(next_states): * return frontier */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __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 = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_frontier = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":906 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":892 * cdef unsigned alt_it * frontier = [] * if i+spanlen+skip >= len(next_states): # <<<<<<<<<<<<<< * return frontier * key = tuple([i,spanlen]) */ - __pyx_t_1 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = PyObject_Length(__pyx_v_next_states); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_v_next_states); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":907 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":893 * frontier = [] * if i+spanlen+skip >= len(next_states): * return frontier # <<<<<<<<<<<<<< @@ -46921,14 +46335,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":908 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":894 * if i+spanlen+skip >= len(next_states): * return frontier * key = tuple([i,spanlen]) # <<<<<<<<<<<<<< * reachable = [] * if key in reachable_buffer: */ - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_i); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_i); @@ -46936,43 +46350,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_INCREF(__pyx_v_spanlen); PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_spanlen); __Pyx_GIVEREF(__pyx_v_spanlen); - __pyx_t_1 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_4))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_4))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_v_key = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":909 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":895 * return frontier * key = tuple([i,spanlen]) * reachable = [] # <<<<<<<<<<<<<< * if key in reachable_buffer: * reachable = reachable_buffer[key] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __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 = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_reachable = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":910 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":896 * key = tuple([i,spanlen]) * reachable = [] * if key in reachable_buffer: # <<<<<<<<<<<<<< * reachable = reachable_buffer[key] * else: */ - __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_key), __pyx_v_reachable_buffer, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_key), __pyx_v_reachable_buffer, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":911 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":897 * reachable = [] * if key in reachable_buffer: * reachable = reachable_buffer[key] # <<<<<<<<<<<<<< * else: * reachable = self.reachable(fwords, i, spanlen) */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_reachable, __pyx_t_1); __pyx_t_1 = 0; @@ -46980,16 +46394,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":913 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":899 * reachable = reachable_buffer[key] * else: * reachable = self.reachable(fwords, i, spanlen) # <<<<<<<<<<<<<< * reachable_buffer[key] = reachable * for nextreachable in reachable: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fwords); @@ -47000,25 +46414,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_INCREF(__pyx_v_spanlen); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_spanlen); __Pyx_GIVEREF(__pyx_v_spanlen); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __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_4)); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_reachable, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":914 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":900 * else: * reachable = self.reachable(fwords, i, spanlen) * reachable_buffer[key] = reachable # <<<<<<<<<<<<<< * for nextreachable in reachable: * for next_id in next_states[nextreachable]: */ - if (PyObject_SetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key), __pyx_v_reachable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key), __pyx_v_reachable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":915 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":901 * reachable = self.reachable(fwords, i, spanlen) * reachable_buffer[key] = reachable * for nextreachable in reachable: # <<<<<<<<<<<<<< @@ -47029,7 +46443,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __pyx_t_2 = __pyx_v_reachable; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_reachable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_reachable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -47037,23 +46451,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod if (!__pyx_t_7 && 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_7 && 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -47062,20 +46476,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_XDECREF_SET(__pyx_v_nextreachable, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":916 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":902 * reachable_buffer[key] = reachable * for nextreachable in reachable: * for next_id in next_states[nextreachable]: # <<<<<<<<<<<<<< * jump = self.shortest(fwords,i,next_id) * if jump < skip: */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_next_states, __pyx_v_nextreachable); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_next_states, __pyx_v_nextreachable); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -47084,23 +46498,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod 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_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_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_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -47109,16 +46523,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_XDECREF_SET(__pyx_v_next_id, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":917 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":903 * for nextreachable in reachable: * for next_id in next_states[nextreachable]: * jump = self.shortest(fwords,i,next_id) # <<<<<<<<<<<<<< * if jump < skip: * continue */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_fwords); @@ -47129,26 +46543,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_INCREF(__pyx_v_next_id); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_next_id); __Pyx_GIVEREF(__pyx_v_next_id); - __pyx_t_11 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_jump, __pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":918 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":904 * for next_id in next_states[nextreachable]: * jump = self.shortest(fwords,i,next_id) * if jump < skip: # <<<<<<<<<<<<<< * continue * if pathlen+jump <= self.max_initial_size: */ - __pyx_t_11 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":919 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":905 * jump = self.shortest(fwords,i,next_id) * if jump < skip: * continue # <<<<<<<<<<<<<< @@ -47160,50 +46574,50 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":920 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":906 * if jump < skip: * continue * if pathlen+jump <= self.max_initial_size: # <<<<<<<<<<<<<< * for alt_id in range(len(fwords[next_id])): * if fwords[next_id][alt_id][0] != EPSILON: */ - __pyx_t_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":921 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":907 * continue * if pathlen+jump <= self.max_initial_size: * for alt_id in range(len(fwords[next_id])): # <<<<<<<<<<<<<< * if fwords[next_id][alt_id][0] != EPSILON: * newel = (next_id,alt_id,pathlen+jump) */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __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 = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_10 = __pyx_t_4; __Pyx_INCREF(__pyx_t_10); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext; } @@ -47212,23 +46626,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_10)) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_10)) { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_10)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -47237,40 +46651,40 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_XDECREF_SET(__pyx_v_alt_id, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":922 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":908 * if pathlen+jump <= self.max_initial_size: * for alt_id in range(len(fwords[next_id])): * if fwords[next_id][alt_id][0] != EPSILON: # <<<<<<<<<<<<<< * newel = (next_id,alt_id,pathlen+jump) * if newel not in frontier: */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_11, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_11, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_14 = PyObject_RichCompare(__pyx_t_4, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_RichCompare(__pyx_t_4, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":923 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":909 * for alt_id in range(len(fwords[next_id])): * if fwords[next_id][alt_id][0] != EPSILON: * newel = (next_id,alt_id,pathlen+jump) # <<<<<<<<<<<<<< * if newel not in frontier: * frontier.append((next_id,alt_id,pathlen+jump)) */ - __pyx_t_14 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_next_id); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_next_id); @@ -47284,27 +46698,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_XDECREF_SET(__pyx_v_newel, ((PyObject*)__pyx_t_11)); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":924 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":910 * if fwords[next_id][alt_id][0] != EPSILON: * newel = (next_id,alt_id,pathlen+jump) * if newel not in frontier: # <<<<<<<<<<<<<< * frontier.append((next_id,alt_id,pathlen+jump)) * return frontier */ - __pyx_t_6 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":925 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":911 * newel = (next_id,alt_id,pathlen+jump) * if newel not in frontier: * frontier.append((next_id,alt_id,pathlen+jump)) # <<<<<<<<<<<<<< * return frontier * */ - __pyx_t_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_next_id); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_next_id); @@ -47315,7 +46729,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; goto __pyx_L14; } @@ -47334,7 +46748,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":926 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":912 * if newel not in frontier: * frontier.append((next_id,alt_id,pathlen+jump)) * return frontier # <<<<<<<<<<<<<< @@ -47404,16 +46818,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(P case 1: 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 = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: 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 = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reachable") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reachable") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -47428,7 +46842,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -47439,7 +46853,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(P return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":928 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":914 * return frontier * * def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<< @@ -47470,35 +46884,35 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reachable", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":929 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":915 * * def reachable(self, fwords, ifrom, dist): * ret = [] # <<<<<<<<<<<<<< * if ifrom >= len(fwords): * return ret */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 929; __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 = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":930 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":916 * def reachable(self, fwords, ifrom, dist): * ret = [] * if ifrom >= len(fwords): # <<<<<<<<<<<<<< * return ret * for alt_id in range(len(fwords[ifrom])): */ - __pyx_t_2 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 930; __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[8]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __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[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":931 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":917 * ret = [] * if ifrom >= len(fwords): * return ret # <<<<<<<<<<<<<< @@ -47513,32 +46927,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":932 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":918 * if ifrom >= len(fwords): * return ret * for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<< * if fwords[ifrom][alt_id][0] == EPSILON: * ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __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 = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__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_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -47547,23 +46961,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 918; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -47572,53 +46986,53 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s __Pyx_XDECREF_SET(__pyx_v_alt_id, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":933 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":919 * return ret * for alt_id in range(len(fwords[ifrom])): * if fwords[ifrom][alt_id][0] == EPSILON: # <<<<<<<<<<<<<< * ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) * else: */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __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_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __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_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __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); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 933; __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 = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":934 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":920 * for alt_id in range(len(fwords[ifrom])): * if fwords[ifrom][alt_id][0] == EPSILON: * ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) # <<<<<<<<<<<<<< * else: * if dist == 0: */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __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_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fwords); @@ -47629,16 +47043,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_dist); __Pyx_GIVEREF(__pyx_v_dist); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __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_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __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 = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __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_3)); __pyx_t_3 = 0; @@ -47647,37 +47061,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":936 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":922 * ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) * else: * if dist == 0: # <<<<<<<<<<<<<< * if ifrom not in ret: * ret.append(ifrom) */ - __pyx_t_8 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":937 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":923 * else: * if dist == 0: * if ifrom not in ret: # <<<<<<<<<<<<<< * ret.append(ifrom) * else: */ - __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifrom, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifrom, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_4 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":938 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":924 * if dist == 0: * if ifrom not in ret: * ret.append(ifrom) # <<<<<<<<<<<<<< * else: * for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): */ - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; @@ -47685,29 +47099,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":940 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":926 * ret.append(ifrom) * else: * for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): # <<<<<<<<<<<<<< * if ifromchild not in ret: * ret.append(ifromchild) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __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_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_v_dist, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_v_dist, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_fwords); @@ -47718,7 +47132,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s __Pyx_GIVEREF(__pyx_t_3); __pyx_t_7 = 0; __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[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; @@ -47726,7 +47140,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; } @@ -47735,23 +47149,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_6)) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_6)) { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_3 = __pyx_t_12(__pyx_t_6); if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -47760,25 +47174,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s __Pyx_XDECREF_SET(__pyx_v_ifromchild, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":941 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":927 * else: * for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): * if ifromchild not in ret: # <<<<<<<<<<<<<< * ret.append(ifromchild) * */ - __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (__pyx_t_9 != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":942 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":928 * for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): * if ifromchild not in ret: * ret.append(ifromchild) # <<<<<<<<<<<<<< * * return ret */ - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L11; } __pyx_L11:; @@ -47791,7 +47205,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":944 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":930 * ret.append(ifromchild) * * return ret # <<<<<<<<<<<<<< @@ -47855,16 +47269,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(Py case 1: 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 = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: 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 = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortest") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortest") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -47879,7 +47293,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.shortest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -47890,7 +47304,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(Py return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":946 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":932 * return ret * * def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<< @@ -47915,7 +47329,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shortest", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":948 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":934 * def shortest(self, fwords, ifrom, ito): * cdef unsigned alt_id * min = 1000 # <<<<<<<<<<<<<< @@ -47925,19 +47339,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st __Pyx_INCREF(__pyx_int_1000); __pyx_v_min = __pyx_int_1000; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":949 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":935 * cdef unsigned alt_id * min = 1000 * if ifrom > ito: # <<<<<<<<<<<<<< * return min * if ifrom == ito: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 949; __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[8]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 935; __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[8]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":950 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":936 * min = 1000 * if ifrom > ito: * return min # <<<<<<<<<<<<<< @@ -47952,19 +47366,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":951 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":937 * if ifrom > ito: * return min * if ifrom == ito: # <<<<<<<<<<<<<< * return 0 * for alt_id in range(len(fwords[ifrom])): */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __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[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __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[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":952 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":938 * return min * if ifrom == ito: * return 0 # <<<<<<<<<<<<<< @@ -47979,41 +47393,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":953 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":939 * if ifrom == ito: * return 0 * for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<< * currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) * if fwords[ifrom][alt_id][0] != EPSILON: */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_alt_id = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":954 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":940 * return 0 * for alt_id in range(len(fwords[ifrom])): * currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) # <<<<<<<<<<<<<< * if fwords[ifrom][alt_id][0] != EPSILON: * currmin += 1 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fwords); @@ -48024,45 +47438,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_ito); __Pyx_GIVEREF(__pyx_v_ito); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __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[8]; __pyx_lineno = 940; __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; __Pyx_XDECREF_SET(__pyx_v_currmin, __pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":955 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":941 * for alt_id in range(len(fwords[ifrom])): * currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) * if fwords[ifrom][alt_id][0] != EPSILON: # <<<<<<<<<<<<<< * currmin += 1 * if currmin < min: */ - __pyx_t_6 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __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_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __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); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __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[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":956 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":942 * currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) * if fwords[ifrom][alt_id][0] != EPSILON: * currmin += 1 # <<<<<<<<<<<<<< * if currmin < min: * min = currmin */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_currmin, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_currmin, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_currmin, __pyx_t_1); __pyx_t_1 = 0; @@ -48070,19 +47484,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":957 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":943 * if fwords[ifrom][alt_id][0] != EPSILON: * currmin += 1 * if currmin < min: # <<<<<<<<<<<<<< * min = currmin * return min */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_currmin, __pyx_v_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __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[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_currmin, __pyx_v_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __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[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":958 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":944 * currmin += 1 * if currmin < min: * min = currmin # <<<<<<<<<<<<<< @@ -48096,7 +47510,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st __pyx_L8:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":959 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":945 * if currmin < min: * min = currmin * return min # <<<<<<<<<<<<<< @@ -48158,7 +47572,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st case 1: 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 = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { @@ -48167,7 +47581,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_next_states") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_next_states") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -48184,7 +47598,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_next_states", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -48195,7 +47609,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":961 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":947 * return min * * def get_next_states(self, _columns, curr_idx, min_dist=2): # <<<<<<<<<<<<<< @@ -48228,26 +47642,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_next_states", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":962 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":948 * * def get_next_states(self, _columns, curr_idx, min_dist=2): * result = [] # <<<<<<<<<<<<<< * candidate = [[curr_idx,0]] * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __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 = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":963 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":949 * def get_next_states(self, _columns, curr_idx, min_dist=2): * result = [] * candidate = [[curr_idx,0]] # <<<<<<<<<<<<<< * * while len(candidate) > 0: */ - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_curr_idx); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_curr_idx); @@ -48255,7 +47669,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __Pyx_INCREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); @@ -48263,7 +47677,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __pyx_v_candidate = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":965 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":951 * candidate = [[curr_idx,0]] * * while len(candidate) > 0: # <<<<<<<<<<<<<< @@ -48271,42 +47685,42 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st * if curr[0] >= len(_columns): */ while (1) { - __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((__pyx_t_3 > 0) != 0); if (!__pyx_t_4) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":966 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":952 * * while len(candidate) > 0: * curr = candidate.pop() # <<<<<<<<<<<<<< * if curr[0] >= len(_columns): * continue */ - __pyx_t_2 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_candidate)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_candidate)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_curr, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":967 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":953 * while len(candidate) > 0: * curr = candidate.pop() * if curr[0] >= len(_columns): # <<<<<<<<<<<<<< * continue * if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_v__columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_v__columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __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 = 967; __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 = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":968 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":954 * curr = candidate.pop() * if curr[0] >= len(_columns): * continue # <<<<<<<<<<<<<< @@ -48318,30 +47732,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":969 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":955 * if curr[0] >= len(_columns): * continue * if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: # <<<<<<<<<<<<<< * result.append(curr[0]); * curr_col = _columns[curr[0]] */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_5, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_5, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromLong(__pyx_v_self->max_initial_size); 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_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_t_6; } else { @@ -48349,37 +47763,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":970 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":956 * continue * if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: * result.append(curr[0]); # <<<<<<<<<<<<<< * curr_col = _columns[curr[0]] * for alt in curr_col: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6; } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":971 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":957 * if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: * result.append(curr[0]); * curr_col = _columns[curr[0]] # <<<<<<<<<<<<<< * for alt in curr_col: * next_id = curr[0]+alt[2] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetItem(__pyx_v__columns, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v__columns, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_curr_col, __pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":972 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":958 * result.append(curr[0]); * curr_col = _columns[curr[0]] * for alt in curr_col: # <<<<<<<<<<<<<< @@ -48390,7 +47804,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __pyx_t_5 = __pyx_v_curr_col; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_curr_col); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_curr_col); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; } @@ -48398,23 +47812,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 958; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -48423,25 +47837,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __Pyx_XDECREF_SET(__pyx_v_alt, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":973 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":959 * curr_col = _columns[curr[0]] * for alt in curr_col: * next_id = curr[0]+alt[2] # <<<<<<<<<<<<<< * jump = 1 * if alt[0] == EPSILON: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_next_id, __pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":974 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":960 * for alt in curr_col: * next_id = curr[0]+alt[2] * jump = 1 # <<<<<<<<<<<<<< @@ -48451,25 +47865,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __Pyx_INCREF(__pyx_int_1); __Pyx_XDECREF_SET(__pyx_v_jump, __pyx_int_1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":975 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":961 * next_id = curr[0]+alt[2] * jump = 1 * if alt[0] == EPSILON: # <<<<<<<<<<<<<< * jump = 0 * if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: */ - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __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); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __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_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":976 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":962 * jump = 1 * if alt[0] == EPSILON: * jump = 0 # <<<<<<<<<<<<<< @@ -48482,30 +47896,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":977 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":963 * if alt[0] == EPSILON: * jump = 0 * if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: # <<<<<<<<<<<<<< * candidate.append([next_id,curr[1]+jump]) * return sorted(result); */ - __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_next_id, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_next_id, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_7) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); - __pyx_t_10 = PyInt_FromLong((__pyx_v_self->max_initial_size + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong((__pyx_v_self->max_initial_size + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __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_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __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 = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_4; } else { @@ -48513,19 +47927,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":978 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":964 * jump = 0 * if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: * candidate.append([next_id,curr[1]+jump]) # <<<<<<<<<<<<<< * return sorted(result); * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_next_id); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_next_id); @@ -48533,7 +47947,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_candidate, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_candidate, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; goto __pyx_L10; } @@ -48543,7 +47957,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __pyx_L3_continue:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":979 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":965 * if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: * candidate.append([next_id,curr[1]+jump]) * return sorted(result); # <<<<<<<<<<<<<< @@ -48551,12 +47965,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st * def input(self, fwords, meta, ctx_name=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_result)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_result)); __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __pyx_r = __pyx_t_1; @@ -48603,7 +48017,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__meta,&__pyx_n_s__ctx_name,0}; PyObject* values[3] = {0,0,0}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":981 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":967 * return sorted(result); * * def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<< @@ -48629,7 +48043,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__meta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { @@ -48638,7 +48052,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -48655,7 +48069,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -48667,30 +48081,30 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj } /* Python wrapper */ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5 = {__Pyx_NAMESTR("lambda5"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5, METH_NOARGS, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3 = {__Pyx_NAMESTR("lambda3"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0); - __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self); + __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6 = {__Pyx_NAMESTR("lambda6"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6, METH_NOARGS, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4 = {__Pyx_NAMESTR("lambda4"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0); - __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self); + __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1150 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1136 * if len(extracts) > 0: * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<< @@ -48698,7 +48112,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambd * fcount[f] += count */ -static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -48707,16 +48121,16 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda6", 0); + __Pyx_RefNannySetupContext("lambda4", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __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 = 1150; __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 = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyList_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyList_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyList_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __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[8]; __pyx_lineno = 1136; __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; @@ -48730,7 +48144,7 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda5.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda3.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -48738,7 +48152,7 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -48747,18 +48161,18 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda5", 0); + __Pyx_RefNannySetupContext("lambda3", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6, 0, __pyx_n_s_125, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4, 0, __pyx_n_s_125, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __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 = 1150; __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 = 1136; __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 = 1150; __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[8]; __pyx_lineno = 1136; __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; @@ -48772,7 +48186,7 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -48781,18 +48195,18 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self } /* Python wrapper */ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ -static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7 = {__Pyx_NAMESTR("lambda7"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7(PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ +static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5 = {__Pyx_NAMESTR("lambda5"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0); - __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, ((PyObject *)__pyx_v_x)); + __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self, ((PyObject *)__pyx_v_x)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1156 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1142 * for f, elist in fphrases.iteritems(): * for e, alslist in elist.iteritems(): * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<< @@ -48800,7 +48214,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambd * count = len(locs) */ -static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -48808,13 +48222,13 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda7", 0); + __Pyx_RefNannySetupContext("lambda5", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __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[8]; __pyx_lineno = 1142; __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[8]; __pyx_lineno = 1156; __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[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -48824,7 +48238,7 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -48833,7 +48247,7 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self } static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1196 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1182 * if self.online: * stats = self.online_stats[ctx_name] * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<< @@ -48859,7 +48273,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genex __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -48899,13 +48313,13 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) { __Pyx_RaiseClosureNameError("fwords"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) { __Pyx_RaiseClosureNameError("fwords"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -48913,23 +48327,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -48939,9 +48353,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_word, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; @@ -48961,7 +48375,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetNone(PyExc_StopIteration); @@ -48979,7 +48393,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":981 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":967 * return sorted(result); * * def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<< @@ -49014,7 +48428,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input(struc __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ctx_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ctx_name); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -49079,9 +48493,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":992 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":978 * cdef Phrase hiero_phrase * * flen = len(fwords) # <<<<<<<<<<<<<< @@ -49090,27 +48504,27 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __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[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_cur_scope->__pyx_v_flen = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":993 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":979 * * flen = len(fwords) * start_time = monitor_cpu() # <<<<<<<<<<<<<< * self.extract_time = 0.0 * self.intersect_time = 0.0 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __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 = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_cur_scope->__pyx_v_start_time = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":994 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":980 * flen = len(fwords) * start_time = monitor_cpu() * self.extract_time = 0.0 # <<<<<<<<<<<<<< @@ -49119,7 +48533,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_self->extract_time = 0.0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":995 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":981 * start_time = monitor_cpu() * self.extract_time = 0.0 * self.intersect_time = 0.0 # <<<<<<<<<<<<<< @@ -49128,20 +48542,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_self->intersect_time = 0.0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":996 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":982 * self.extract_time = 0.0 * self.intersect_time = 0.0 * nodes_isteps_away_buffer = {} # <<<<<<<<<<<<<< * hit = 0 * reachable_buffer = {} */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":997 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":983 * self.intersect_time = 0.0 * nodes_isteps_away_buffer = {} * hit = 0 # <<<<<<<<<<<<<< @@ -49150,46 +48564,46 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_hit = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":998 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":984 * nodes_isteps_away_buffer = {} * hit = 0 * reachable_buffer = {} # <<<<<<<<<<<<<< * * # Phrase pairs processed by suffix array extractor. Do not re-extract */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_cur_scope->__pyx_v_reachable_buffer = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1003 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":989 * # during online extraction. This is probably the hackiest part of * # online grammar extraction. * seen_phrases = set() # <<<<<<<<<<<<<< * * # Do not cache between sentences */ - __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_cur_scope->__pyx_v_seen_phrases = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1006 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":992 * * # Do not cache between sentences * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<< * * frontier = [] */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __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_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __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); @@ -49198,20 +48612,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_cur_scope->__pyx_v_self->rules->root = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1008 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":994 * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * * frontier = [] # <<<<<<<<<<<<<< * for i in range(len(fwords)): * for alt in range(0, len(fwords[i])): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __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 = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_cur_scope->__pyx_v_frontier = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1009 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":995 * * frontier = [] * for i in range(len(fwords)): # <<<<<<<<<<<<<< @@ -49220,72 +48634,72 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __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[8]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1010 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":996 * frontier = [] * for i in range(len(fwords)): * for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<< * if fwords[i][alt][0] != EPSILON: * frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_cur_scope->__pyx_v_alt = __pyx_t_7; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1011 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":997 * for i in range(len(fwords)): * for alt in range(0, len(fwords[i])): * if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<< * frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __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_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); 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); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1012 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":998 * for alt in range(0, len(fwords[i])): * if fwords[i][alt][0] != EPSILON: * frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) # <<<<<<<<<<<<<< * * xroot = None */ - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __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 = 1012; __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 = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); @@ -49311,7 +48725,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_10 = 0; __pyx_t_1 = 0; __pyx_t_11 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_12)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_12)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; goto __pyx_L8; } @@ -49319,7 +48733,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1014 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1000 * frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) * * xroot = None # <<<<<<<<<<<<<< @@ -49330,7 +48744,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(Py_None); __pyx_cur_scope->__pyx_v_xroot = Py_None; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1015 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1001 * * xroot = None * x1 = sym_setindex(self.category, 1) # <<<<<<<<<<<<<< @@ -49339,33 +48753,33 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_x1 = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1016 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1002 * xroot = None * x1 = sym_setindex(self.category, 1) * if x1 in self.rules.root.children: # <<<<<<<<<<<<<< * xroot = self.rules.root.children[x1] * else: */ - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_12, __pyx_t_11, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_12, __pyx_t_11, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_14 = (__pyx_t_9 != 0); if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1017 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1003 * x1 = sym_setindex(self.category, 1) * if x1 in self.rules.root.children: * xroot = self.rules.root.children[x1] # <<<<<<<<<<<<<< * else: * xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot); @@ -49376,21 +48790,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1019 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1005 * xroot = self.rules.root.children[x1] * else: * xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) # <<<<<<<<<<<<<< * self.rules.root.children[x1] = xroot * */ - __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot); @@ -49398,21 +48812,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1020 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1006 * else: * xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) * self.rules.root.children[x1] = xroot # <<<<<<<<<<<<<< * * for i in range(self.min_gap_size, len(fwords)): */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_SetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_xroot, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_xroot, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1022 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1008 * self.rules.root.children[x1] = xroot * * for i in range(self.min_gap_size, len(fwords)): # <<<<<<<<<<<<<< @@ -49421,81 +48835,81 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_t_11 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_11); - __pyx_t_2 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (__pyx_t_5 = __pyx_cur_scope->__pyx_v_self->min_gap_size; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1023 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1009 * * for i in range(self.min_gap_size, len(fwords)): * for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<< * if fwords[i][alt][0] != EPSILON: * frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) */ - __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_cur_scope->__pyx_v_alt = __pyx_t_7; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1024 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1010 * for i in range(self.min_gap_size, len(fwords)): * for alt in range(0, len(fwords[i])): * if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<< * frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) * */ - __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_12, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_12, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1025 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1011 * for alt in range(0, len(fwords[i])): * if fwords[i][alt][0] != EPSILON: * frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) # <<<<<<<<<<<<<< * * next_states = [] */ - __pyx_t_1 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_self->min_gap_size)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_self->min_gap_size)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __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 = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __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 = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -49521,7 +48935,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_3 = 0; __pyx_t_15 = 0; __pyx_t_8 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_16)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_16)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; goto __pyx_L14; } @@ -49529,20 +48943,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1027 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1013 * frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) * * next_states = [] # <<<<<<<<<<<<<< * for i in range(len(fwords)): * next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) */ - __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(((PyObject *)__pyx_t_16)); __pyx_cur_scope->__pyx_v_next_states = ((PyObject*)__pyx_t_16); __pyx_t_16 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1028 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1014 * * next_states = [] * for i in range(len(fwords)): # <<<<<<<<<<<<<< @@ -49551,25 +48965,25 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_t_16 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_16); - __pyx_t_2 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1029 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1015 * next_states = [] * for i in range(len(fwords)): * next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) # <<<<<<<<<<<<<< * * while len(frontier) > 0: */ - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __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 = 1029; __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 = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_fwords); @@ -49580,15 +48994,15 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_15); __pyx_t_8 = 0; __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_15); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_15); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1031 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1017 * next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) * * while len(frontier) > 0: # <<<<<<<<<<<<<< @@ -49596,25 +49010,25 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: */ while (1) { - __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((__pyx_t_2 > 0) != 0); if (!__pyx_t_14) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1032 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1018 * * while len(frontier) > 0: * new_frontier = [] # <<<<<<<<<<<<<< * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: * word_id = fwords[i][alt][0] */ - __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject*)__pyx_t_15)); __Pyx_GIVEREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1033 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1019 * while len(frontier) > 0: * new_frontier = [] * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: # <<<<<<<<<<<<<< @@ -49625,9 +49039,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_15)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; @@ -49639,7 +49053,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 8)) { if (size > 8) __Pyx_RaiseTooManyValuesError(8); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -49673,7 +49087,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( Py_ssize_t i; PyObject** temps[8] = {&__pyx_t_16,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_17,&__pyx_t_18}; for (i=0; i < 8; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -49683,7 +49097,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( { Py_ssize_t index = -1; PyObject** temps[8] = {&__pyx_t_16,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_17,&__pyx_t_18}; - __pyx_t_19 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; @@ -49692,7 +49106,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L22_unpacking_done; @@ -49700,14 +49114,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L22_unpacking_done:; } - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_16); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_16); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_cur_scope->__pyx_v_k = __pyx_t_5; __pyx_cur_scope->__pyx_v_i = __pyx_t_7; @@ -49733,19 +49147,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1034 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1020 * new_frontier = [] * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: * word_id = fwords[i][alt][0] # <<<<<<<<<<<<<< * spanlen = fwords[i][alt][2] * # TODO get rid of k -- pathlen is replacing it */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_18, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_18, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_word_id); @@ -49753,19 +49167,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1035 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1021 * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: * word_id = fwords[i][alt][0] * spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<< * # TODO get rid of k -- pathlen is replacing it * if word_id == EPSILON: */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__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_18 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_18, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_18, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen); @@ -49773,47 +49187,47 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1037 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1023 * spanlen = fwords[i][alt][2] * # TODO get rid of k -- pathlen is replacing it * if word_id == EPSILON: # <<<<<<<<<<<<<< * # skipping because word_id is epsilon * if i+spanlen >= len(fwords): */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_18 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1039 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1025 * if word_id == EPSILON: * # skipping because word_id is epsilon * if i+spanlen >= len(fwords): # <<<<<<<<<<<<<< * continue * for nualt in range(0,len(fwords[i+spanlen])): */ - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_18); - __pyx_t_6 = PyObject_Length(__pyx_t_18); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_t_18); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_17 = PyObject_RichCompare(__pyx_t_3, __pyx_t_18, Py_GE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_RichCompare(__pyx_t_3, __pyx_t_18, Py_GE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1040 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1026 * # skipping because word_id is epsilon * if i+spanlen >= len(fwords): * continue # <<<<<<<<<<<<<< @@ -49825,43 +49239,43 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1041 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1027 * if i+spanlen >= len(fwords): * continue * for nualt in range(0,len(fwords[i+spanlen])): # <<<<<<<<<<<<<< * frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) * continue */ - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_18); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_18); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_6 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_6; __pyx_t_21+=1) { __pyx_cur_scope->__pyx_v_nualt = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1042 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1028 * continue * for nualt in range(0,len(fwords[i+spanlen])): * frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); @@ -49887,11 +49301,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_17 = 0; __pyx_t_3 = 0; __pyx_t_18 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1043 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1029 * for nualt in range(0,len(fwords[i+spanlen])): * frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) * continue # <<<<<<<<<<<<<< @@ -49903,19 +49317,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L23:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1045 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1031 * continue * * phrase = prefix + (word_id,) # <<<<<<<<<<<<<< * hiero_phrase = Phrase(phrase) * arity = hiero_phrase.arity() */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1045; __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 = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_word_id); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_word_id); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_word_id); - __pyx_t_18 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_phrase); @@ -49923,19 +49337,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1046 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1032 * * phrase = prefix + (word_id,) * hiero_phrase = Phrase(phrase) # <<<<<<<<<<<<<< * arity = hiero_phrase.arity() * */ - __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_cur_scope->__pyx_v_phrase); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)); @@ -49943,23 +49357,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1047 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1033 * phrase = prefix + (word_id,) * hiero_phrase = Phrase(phrase) * arity = hiero_phrase.arity() # <<<<<<<<<<<<<< * * lookup_required = False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_cur_scope->__pyx_v_arity = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1049 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1035 * arity = hiero_phrase.arity() * * lookup_required = False # <<<<<<<<<<<<<< @@ -49968,30 +49382,30 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_lookup_required = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1050 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1036 * * lookup_required = False * if word_id in node.children: # <<<<<<<<<<<<<< * if node.children[word_id] is None: * # Path dead-ends at this node */ - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_14 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_18, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_18, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_9 = (__pyx_t_14 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1051 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1037 * 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_1 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_9 = (__pyx_t_1 == Py_None); @@ -49999,7 +49413,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_14 = (__pyx_t_9 != 0); if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1053 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1039 * if node.children[word_id] is None: * # Path dead-ends at this node * continue # <<<<<<<<<<<<<< @@ -50011,16 +49425,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1056 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1042 * else: * # Path continues at this node * node = node.children[word_id] # <<<<<<<<<<<<<< * else: * if node.suffix_link is None: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_node); @@ -50033,21 +49447,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1058 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1044 * node = node.children[word_id] * else: * if node.suffix_link is None: # <<<<<<<<<<<<<< * # Current node is root; lookup required * lookup_required = True */ - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __pyx_t_14 = (__pyx_t_18 == Py_None); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_9 = (__pyx_t_14 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1060 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1046 * if node.suffix_link is None: * # Current node is root; lookup required * lookup_required = True # <<<<<<<<<<<<<< @@ -50059,36 +49473,36 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1062 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1048 * 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_14 = (__pyx_t_9 != 0); if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1063 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1049 * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_14 = (__pyx_t_1 == Py_None); @@ -50096,19 +49510,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = (__pyx_t_14 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1065 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1051 * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1066 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1052 * # Suffix link reports path is dead end * node.children[word_id] = None * continue # <<<<<<<<<<<<<< @@ -50120,7 +49534,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1069 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1055 * else: * # Suffix link indicates lookup is reqired * lookup_required = True # <<<<<<<<<<<<<< @@ -50134,18 +49548,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1072 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1058 * else: * #ERROR: We never get here * raise Exception("Keyword trie error") # <<<<<<<<<<<<<< * # checking whether lookup_required * if lookup_required: */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L30:; } @@ -50153,7 +49567,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L27:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1074 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1060 * raise Exception("Keyword trie error") * # checking whether lookup_required * if lookup_required: # <<<<<<<<<<<<<< @@ -50163,7 +49577,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = (__pyx_cur_scope->__pyx_v_lookup_required != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1075 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1061 * # checking whether lookup_required * if lookup_required: * new_node = None # <<<<<<<<<<<<<< @@ -50175,66 +49589,66 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_new_node, Py_None); __Pyx_GIVEREF(Py_None); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1076 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1062 * 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_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1079 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1065 * # 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_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1080 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1066 * # 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); 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_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1081 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1067 * 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_1, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node); @@ -50245,7 +49659,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1083 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1069 * phrase=hiero_phrase) * else: * if arity > 0: # <<<<<<<<<<<<<< @@ -50255,16 +49669,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = ((__pyx_cur_scope->__pyx_v_arity > 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1085 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1071 * if arity > 0: * # Intersecting because of arity > 0 * intersect_start_time = monitor_cpu() # <<<<<<<<<<<<<< * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) * intersect_stop_time = monitor_cpu() */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __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 = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_intersect_start_time); @@ -50272,22 +49686,22 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1086 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1072 * # Intersecting because of arity > 0 * intersect_start_time = monitor_cpu() * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) # <<<<<<<<<<<<<< * intersect_stop_time = monitor_cpu() * self.intersect_time += intersect_stop_time - intersect_start_time */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __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_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __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 *)((struct __pyx_vtabstruct_4cdec_2sa_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_1, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_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_1, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); @@ -50295,16 +49709,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1087 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1073 * intersect_start_time = monitor_cpu() * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) * intersect_stop_time = monitor_cpu() # <<<<<<<<<<<<<< * self.intersect_time += intersect_stop_time - intersect_start_time * else: */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1073; __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 = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_intersect_stop_time); @@ -50312,66 +49726,66 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1088 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1074 * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) * intersect_stop_time = monitor_cpu() * self.intersect_time += intersect_stop_time - intersect_start_time # <<<<<<<<<<<<<< * else: * # Suffix array search */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_intersect_stop_time, __pyx_cur_scope->__pyx_v_intersect_start_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_intersect_stop_time, __pyx_cur_scope->__pyx_v_intersect_start_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_18); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_18); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_cur_scope->__pyx_v_self->intersect_time = __pyx_t_4; goto __pyx_L34; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1091 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1077 * else: * # Suffix array search * phrase_location = node.phrase_location # <<<<<<<<<<<<<< * 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_phrase_location, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_18)); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1092 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1078 * # Suffix array search * phrase_location = node.phrase_location * 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_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_21)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_21)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); @@ -50385,7 +49799,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_1 = 0; __pyx_t_17 = 0; __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; @@ -50394,7 +49808,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1093 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1079 * phrase_location = node.phrase_location * 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: # <<<<<<<<<<<<<< @@ -50405,24 +49819,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_14 = (__pyx_t_9 != 0); if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1094 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1080 * 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_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); @@ -50433,7 +49847,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1096 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1082 * phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) * else: * phrase_location = None # <<<<<<<<<<<<<< @@ -50449,7 +49863,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L34:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1098 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1084 * phrase_location = None * * if phrase_location is None: # <<<<<<<<<<<<<< @@ -50460,19 +49874,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = (__pyx_t_14 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1099 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1085 * * if phrase_location is None: * node.children[word_id] = None # <<<<<<<<<<<<<< * # Search failed * continue */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); 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); - if (PyObject_SetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1101 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1087 * node.children[word_id] = None * # Search failed * continue # <<<<<<<<<<<<<< @@ -50484,7 +49898,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L36:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1103 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1089 * continue * # Search succeeded * suffix_link = self.rules.root # <<<<<<<<<<<<<< @@ -50498,33 +49912,33 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1104 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1090 * # 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_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = (__pyx_t_10 != Py_None); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = (__pyx_t_9 != 0); if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1105 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1091 * 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_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link); @@ -50535,35 +49949,35 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L37:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1106 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1092 * 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_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1107 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1093 * 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_10, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1108 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1094 * 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_10, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node); @@ -50573,19 +49987,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L33:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1109 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1095 * suffix_link=suffix_link, * phrase=hiero_phrase) * node.children[word_id] = new_node # <<<<<<<<<<<<<< * node = new_node * */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - if (PyObject_SetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1110 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1096 * phrase=hiero_phrase) * node.children[word_id] = new_node * node = new_node # <<<<<<<<<<<<<< @@ -50597,7 +50011,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_cur_scope->__pyx_v_new_node); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_node); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1115 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1101 * This should happen before we get to extraction (so that * the node will exist if needed)''' * if arity < self.max_nonterminals: # <<<<<<<<<<<<<< @@ -50607,31 +50021,31 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_14 = ((__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals) != 0); if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1116 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1102 * 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_12 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xcat_index); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1117 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1103 * 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_21 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_cur_scope->__pyx_v_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_21); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1118 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1104 * xcat_index = arity+1 * xcat = sym_setindex(self.category, xcat_index) * suffix_link_xcat_index = xcat_index # <<<<<<<<<<<<<< @@ -50643,24 +50057,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index, __pyx_cur_scope->__pyx_v_xcat_index); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xcat_index); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1119 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1105 * 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_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1120 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1106 * 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_12 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index, __pyx_t_12); @@ -50670,159 +50084,159 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L39:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1121 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1107 * 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_21 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_cur_scope->__pyx_v_suffix_link_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_21); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1122 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1108 * 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_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1123 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1109 * 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 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1124 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1110 * 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_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); 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_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_18, 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_18)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_18)); 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_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_18), NULL); 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_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1122 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1108 * 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_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_SetItemInt(__pyx_t_12, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_10, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_12, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_10, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L38; } __pyx_L38:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1127 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1113 * * # sample from range * if not is_shadow_path: # <<<<<<<<<<<<<< * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = ( node.phrase_location).num_subpatterns */ - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = ((!__pyx_t_14) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1128 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1114 * # sample from range * if not is_shadow_path: * sample = self.sampler.sample(node.phrase_location) # <<<<<<<<<<<<<< * num_subpatterns = ( node.phrase_location).num_subpatterns * chunklen = IntList(initial_len=num_subpatterns) */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sample, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_12)); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1129 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1115 * if not is_shadow_path: * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = ( node.phrase_location).num_subpatterns # <<<<<<<<<<<<<< * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_21 = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_12)->num_subpatterns; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1130 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1116 * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = ( 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_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_chunklen)); @@ -50830,7 +50244,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1131 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1117 * num_subpatterns = ( node.phrase_location).num_subpatterns * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: # <<<<<<<<<<<<<< @@ -50840,7 +50254,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_21 = __pyx_cur_scope->__pyx_v_num_subpatterns; for (__pyx_cur_scope->__pyx_v_j = 0; __pyx_cur_scope->__pyx_v_j < __pyx_t_21; __pyx_cur_scope->__pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1132 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1118 * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) # <<<<<<<<<<<<<< @@ -50850,21 +50264,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( (__pyx_cur_scope->__pyx_v_chunklen->arr[__pyx_cur_scope->__pyx_v_j]) = ((struct __pyx_vtabstruct_4cdec_2sa_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); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1133 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1119 * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) * extracts = [] # <<<<<<<<<<<<<< * j = 0 * extract_start = monitor_cpu() */ - __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extracts, ((PyObject*)__pyx_t_18)); __Pyx_GIVEREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1134 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1120 * chunklen.arr[j] = hiero_phrase.chunklen(j) * extracts = [] * j = 0 # <<<<<<<<<<<<<< @@ -50873,16 +50287,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_j = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1135 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1121 * extracts = [] * j = 0 * extract_start = monitor_cpu() # <<<<<<<<<<<<<< * while j < sample.len: * extract = [] */ - __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_12 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_start); @@ -50890,7 +50304,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1136 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1122 * j = 0 * extract_start = monitor_cpu() * while j < sample.len: # <<<<<<<<<<<<<< @@ -50901,21 +50315,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = ((__pyx_cur_scope->__pyx_v_j < __pyx_cur_scope->__pyx_v_sample->len) != 0); if (!__pyx_t_9) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1137 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1123 * extract_start = monitor_cpu() * while j < sample.len: * extract = [] # <<<<<<<<<<<<<< * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) */ - __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_12)); __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1139 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1125 * extract = [] * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -50924,21 +50338,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_f_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1140 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1126 * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) * loc = tuple(sample[j:j+num_subpatterns]) # <<<<<<<<<<<<<< * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) * extracts.extend([(e, loc) for e in extract]) */ - __pyx_t_12 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_cur_scope->__pyx_v_sample), __pyx_cur_scope->__pyx_v_j, (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_cur_scope->__pyx_v_sample), __pyx_cur_scope->__pyx_v_j, (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns), NULL, NULL, NULL, 1, 1, 1); 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_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_18), NULL); 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(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_loc); @@ -50946,36 +50360,36 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1141 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1127 * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) * loc = tuple(sample[j:j+num_subpatterns]) * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) # <<<<<<<<<<<<<< * extracts.extend([(e, loc) for e in extract]) * j = j + num_subpatterns */ - __pyx_t_12 = ((struct __pyx_vtabstruct_4cdec_2sa_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_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((struct __pyx_vtabstruct_4cdec_2sa_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_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_extract); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_extract, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1142 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1128 * loc = tuple(sample[j:j+num_subpatterns]) * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) * extracts.extend([(e, loc) for e in extract]) # <<<<<<<<<<<<<< * j = j + num_subpatterns * */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_extract) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_extract)) { __pyx_t_10 = __pyx_cur_scope->__pyx_v_extract; __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0; __pyx_t_22 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_22 = Py_TYPE(__pyx_t_10)->tp_iternext; } @@ -50983,23 +50397,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_10)) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_17 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_17 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_10)) { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_10)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_17 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_17 = __pyx_t_22(__pyx_t_10); if (unlikely(!__pyx_t_17)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -51009,7 +50423,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_cur_scope->__pyx_v_e); @@ -51017,22 +50431,22 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(__pyx_cur_scope->__pyx_v_loc); PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_cur_scope->__pyx_v_loc); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_loc); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_18, (PyObject*)__pyx_t_17))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_ListComp_Append(__pyx_t_18, (PyObject*)__pyx_t_17))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __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 = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_18)); __Pyx_GIVEREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - __pyx_t_18 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1143 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1129 * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) * extracts.extend([(e, loc) for e in extract]) * j = j + num_subpatterns # <<<<<<<<<<<<<< @@ -51042,7 +50456,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1145 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1131 * j = j + num_subpatterns * * num_samples = sample.len/num_subpatterns # <<<<<<<<<<<<<< @@ -51057,7 +50471,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __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))) { #ifdef WITH_THREAD @@ -51067,20 +50481,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1146 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1132 * * 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_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_stop); @@ -51088,46 +50502,46 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1147 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1133 * num_samples = sample.len/num_subpatterns * extract_stop = monitor_cpu() * self.extract_time = self.extract_time + extract_stop - extract_start # <<<<<<<<<<<<<< * if len(extracts) > 0: * fcount = Counter() */ - __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_18 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Subtract(__pyx_t_18, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Subtract(__pyx_t_18, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_cur_scope->__pyx_v_self->extract_time = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1148 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1134 * extract_stop = monitor_cpu() * self.extract_time = self.extract_time + extract_stop - extract_start * if len(extracts) > 0: # <<<<<<<<<<<<<< * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) */ - __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = ((__pyx_t_6 > 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1149 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1135 * self.extract_time = self.extract_time + extract_stop - extract_start * if len(extracts) > 0: * fcount = Counter() # <<<<<<<<<<<<<< * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) * for (f, e, count, als), loc in extracts: */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__Counter); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__Counter); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_18 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_fcount); @@ -51135,23 +50549,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1150 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1136 * if len(extracts) > 0: * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<< * for (f, e, count, als), loc in extracts: * fcount[f] += count */ - __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5, 0, __pyx_n_s_128, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3, 0, __pyx_n_s_128, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; @@ -51160,7 +50574,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1151 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1137 * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) * for (f, e, count, als), loc in extracts: # <<<<<<<<<<<<<< @@ -51171,9 +50585,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { PyObject* sequence = __pyx_t_12; @@ -51185,7 +50599,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -51198,16 +50612,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(__pyx_t_17); #else - __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); #endif __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; @@ -51215,7 +50629,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GOTREF(__pyx_t_18); index = 1; __pyx_t_17 = __pyx_t_20(__pyx_t_1); if (unlikely(!__pyx_t_17)) goto __pyx_L50_unpacking_failed; __Pyx_GOTREF(__pyx_t_17); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L51_unpacking_done; @@ -51223,7 +50637,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L51_unpacking_done:; } if ((likely(PyTuple_CheckExact(__pyx_t_18))) || (PyList_CheckExact(__pyx_t_18))) { @@ -51236,7 +50650,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -51258,7 +50672,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_11,&__pyx_t_8}; for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -51268,7 +50682,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_11,&__pyx_t_8}; - __pyx_t_16 = PyObject_GetIter(__pyx_t_18); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_GetIter(__pyx_t_18); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_16)->tp_iternext; @@ -51277,7 +50691,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_16), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_16), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L53_unpacking_done; @@ -51285,7 +50699,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L53_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); @@ -51309,7 +50723,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1152 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1138 * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) * for (f, e, count, als), loc in extracts: * fcount[f] += count # <<<<<<<<<<<<<< @@ -51318,38 +50732,38 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); __pyx_t_12 = __pyx_cur_scope->__pyx_v_f; - __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_17, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_17, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1153 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1139 * for (f, e, count, als), loc in extracts: * fcount[f] += count * fphrases[f][e][als].append(loc) # <<<<<<<<<<<<<< * for f, elist in fphrases.iteritems(): * for e, alslist in elist.iteritems(): */ - __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fphrases, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fphrases, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_18 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = __Pyx_PyObject_Append(__pyx_t_12, __pyx_cur_scope->__pyx_v_loc); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_Append(__pyx_t_12, __pyx_cur_scope->__pyx_v_loc); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1154 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1140 * fcount[f] += count * fphrases[f][e][als].append(loc) * for f, elist in fphrases.iteritems(): # <<<<<<<<<<<<<< @@ -51359,9 +50773,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_6 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_fphrases == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_18 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_21)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_21)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = __pyx_t_18; @@ -51369,7 +50783,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_23, &__pyx_t_6, &__pyx_t_18, &__pyx_t_12, NULL, __pyx_t_21); if (unlikely(__pyx_t_7 == 0)) break; - if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_GOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); @@ -51381,7 +50795,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1155 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1141 * fphrases[f][e][als].append(loc) * for f, elist in fphrases.iteritems(): * for e, alslist in elist.iteritems(): # <<<<<<<<<<<<<< @@ -51391,9 +50805,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_24 = 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 = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_18 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_25), (&__pyx_t_7)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_25), (&__pyx_t_7)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = __pyx_t_18; @@ -51401,7 +50815,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( while (1) { __pyx_t_5 = __Pyx_dict_iter_next(__pyx_t_12, __pyx_t_25, &__pyx_t_24, &__pyx_t_18, &__pyx_t_17, NULL, __pyx_t_7); if (unlikely(__pyx_t_5 == 0)) break; - if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_GOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); @@ -51413,30 +50827,30 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1156 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1142 * for f, elist in fphrases.iteritems(): * for e, alslist in elist.iteritems(): * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<< * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) * count = len(locs) */ - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_18)); - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7, 0, __pyx_n_s_128, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5, 0, __pyx_n_s_128, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_18, ((PyObject *)__pyx_n_s__key), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_18, ((PyObject *)__pyx_n_s__key), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_17), ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_17), ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; @@ -51450,7 +50864,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -51463,16 +50877,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(__pyx_t_17); #else - __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_11)->tp_iternext; @@ -51480,7 +50894,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GOTREF(__pyx_t_18); index = 1; __pyx_t_17 = __pyx_t_20(__pyx_t_11); if (unlikely(!__pyx_t_17)) goto __pyx_L58_unpacking_failed; __Pyx_GOTREF(__pyx_t_17); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L59_unpacking_done; @@ -51488,7 +50902,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L59_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment); @@ -51500,41 +50914,41 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1157 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1143 * for e, alslist in elist.iteritems(): * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) # <<<<<<<<<<<<<< * count = len(locs) * scores = self.scorer.score(FeatureContext( */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__itertools); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__itertools); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__chain); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__chain); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; - __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); @@ -51542,58 +50956,58 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1158 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1144 * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) * count = len(locs) # <<<<<<<<<<<<<< * scores = self.scorer.score(FeatureContext( * f, e, count, fcount[f], num_samples, */ - __pyx_t_26 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_26 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_count, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1159 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1145 * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) * count = len(locs) * scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<< * f, e, count, fcount[f], num_samples, * (k,i+spanlen), locs, input_match, */ - __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1160 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1146 * count = len(locs) * scores = self.scorer.score(FeatureContext( * f, e, count, fcount[f], num_samples, # <<<<<<<<<<<<<< * (k,i+spanlen), locs, input_match, * fwords, self.fda, self.eda, */ - __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1161 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1147 * scores = self.scorer.score(FeatureContext( * f, e, count, fcount[f], num_samples, * (k,i+spanlen), locs, input_match, # <<<<<<<<<<<<<< * fwords, self.fda, self.eda, * meta, */ - __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __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(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); @@ -51602,16 +51016,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_11 = 0; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1165 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1151 * meta, * # Include online stats. None if none. * self.online_ctx_lookup(f, e, ctx_name))) # <<<<<<<<<<<<<< * # Phrase pair processed * if self.online: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_f); @@ -51622,11 +51036,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ctx_name); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_cur_scope->__pyx_v_ctx_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ctx_name); - __pyx_t_16 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_f); @@ -51667,11 +51081,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_8 = 0; __pyx_t_3 = 0; __pyx_t_16 = 0; - __pyx_t_16 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_16)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_16)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); @@ -51679,7 +51093,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1167 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1153 * self.online_ctx_lookup(f, e, ctx_name))) * # Phrase pair processed * if self.online: # <<<<<<<<<<<<<< @@ -51689,14 +51103,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = (__pyx_cur_scope->__pyx_v_self->online != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1168 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1154 * # Phrase pair processed * if self.online: * seen_phrases.add((f, e)) # <<<<<<<<<<<<<< * yield Rule(self.category, f, e, scores, alignment) * */ - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_f); @@ -51704,22 +51118,22 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); - __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; goto __pyx_L60; } __pyx_L60:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1169 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1155 * if self.online: * seen_phrases.add((f, e)) * yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<< * * if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size: */ - __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_16 = PyTuple_New(5); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyTuple_New(5); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); @@ -51736,7 +51150,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_cur_scope->__pyx_v_alignment); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; __pyx_r = __pyx_t_11; @@ -51776,7 +51190,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_23 = __pyx_cur_scope->__pyx_t_7; __pyx_t_24 = __pyx_cur_scope->__pyx_t_8; __pyx_t_25 = __pyx_cur_scope->__pyx_t_9; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } @@ -51791,41 +51205,41 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L32:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1171 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1157 * yield Rule(self.category, f, e, scores, 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, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) */ - __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_23 < __pyx_cur_scope->__pyx_v_self->max_length); if (__pyx_t_9) { - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_10); - __pyx_t_23 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_14) { - __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_28 = __pyx_t_27; } else { @@ -51837,45 +51251,45 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1172 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1158 * * 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, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) * num_subpatterns = arity */ - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyNumber_Add(__pyx_t_12, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_t_12, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_10); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_10); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_23 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_23; __pyx_t_21+=1) { __pyx_cur_scope->__pyx_v_alt_id = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1173 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1159 * 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, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) # <<<<<<<<<<<<<< * num_subpatterns = arity * if not is_shadow_path: */ - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_16 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); @@ -51901,11 +51315,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_16 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_18)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_18)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1174 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1160 * for alt_id in range(len(fwords[i+spanlen])): * new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) * num_subpatterns = arity # <<<<<<<<<<<<<< @@ -51914,18 +51328,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_cur_scope->__pyx_v_arity; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1175 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1161 * new_frontier.append((k, i+spanlen, input_match, 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_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = ((!__pyx_t_14) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1176 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1162 * num_subpatterns = arity * if not is_shadow_path: * num_subpatterns = num_subpatterns + 1 # <<<<<<<<<<<<<< @@ -51937,14 +51351,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L65:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1177 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1163 * 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_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (((__pyx_t_23 + 1) < __pyx_cur_scope->__pyx_v_self->max_length) != 0); if (__pyx_t_9) { __pyx_t_14 = ((__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals) != 0); @@ -51960,7 +51374,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1178 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1164 * 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) # <<<<<<<<<<<<<< @@ -51969,16 +51383,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, (__pyx_cur_scope->__pyx_v_arity + 1)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1179 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1165 * 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xnode); @@ -51986,18 +51400,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1181 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1167 * 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_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); @@ -52011,7 +51425,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen); __pyx_t_16 = 0; __pyx_t_18 = 0; - __pyx_t_18 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_10))); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_10))); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_18)); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_key)); @@ -52019,39 +51433,39 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1182 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1168 * # 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_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_frontier_nodes, ((PyObject *)__pyx_t_18)); __Pyx_GIVEREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1183 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1169 * 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_14 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_key), ((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_key), ((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_14 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1184 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1170 * 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_18 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_frontier_nodes, __pyx_t_18); @@ -52061,20 +51475,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1186 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1172 * 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_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_129); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_129); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_11 = PyTuple_New(7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -52097,7 +51511,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer)); __pyx_t_10 = 0; __pyx_t_16 = 0; - __pyx_t_16 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; @@ -52106,18 +51520,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1187 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1173 * 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 = 1187; __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 = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L67:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1189 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1175 * nodes_isteps_away_buffer[key] = frontier_nodes * * for i, alt, pathlen in frontier_nodes: # <<<<<<<<<<<<<< @@ -52128,7 +51542,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_16 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_16); __pyx_t_23 = 0; __pyx_t_22 = NULL; } else { - __pyx_t_23 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __pyx_t_22 = Py_TYPE(__pyx_t_16)->tp_iternext; } @@ -52136,23 +51550,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_16)) { if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_16)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_16, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PySequence_ITEM(__pyx_t_16, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_16)) { if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_16)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_16, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PySequence_ITEM(__pyx_t_16, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_11 = __pyx_t_22(__pyx_t_16); if (unlikely(!__pyx_t_11)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -52168,7 +51582,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -52184,18 +51598,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_12); #else - __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); #endif __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; @@ -52205,7 +51619,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GOTREF(__pyx_t_10); index = 2; __pyx_t_12 = __pyx_t_20(__pyx_t_3); if (unlikely(!__pyx_t_12)) goto __pyx_L70_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L71_unpacking_done; @@ -52213,12 +51627,12 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L71_unpacking_done:; } - __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_cur_scope->__pyx_v_i = __pyx_t_21; __pyx_cur_scope->__pyx_v_alt = __pyx_t_7; @@ -52227,40 +51641,40 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1190 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1176 * * for i, alt, pathlen in frontier_nodes: * new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) # <<<<<<<<<<<<<< * frontier = new_frontier * */ - __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 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_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); @@ -52286,7 +51700,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_10 = 0; __pyx_t_18 = 0; __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; @@ -52300,7 +51714,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1191 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1177 * for i, alt, pathlen in frontier_nodes: * new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) * frontier = new_frontier # <<<<<<<<<<<<<< @@ -52313,7 +51727,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier)); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1194 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1180 * * # Online rule extraction and scoring * if self.online: # <<<<<<<<<<<<<< @@ -52323,55 +51737,55 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = (__pyx_cur_scope->__pyx_v_self->online != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1195 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1181 * # Online rule extraction and scoring * if self.online: * stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<< * f_syms = tuple(word[0][0] for word in fwords) * for f, lex_i, lex_j in self.get_f_phrases(f_syms): */ - __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_cur_scope->__pyx_v_ctx_name); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_cur_scope->__pyx_v_ctx_name); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_cur_scope->__pyx_v_stats = __pyx_t_15; __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1196 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1182 * if self.online: * stats = self.online_stats[ctx_name] * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<< * for f, lex_i, lex_j in self.get_f_phrases(f_syms): * spanlen = (lex_j - lex_i) + 1 */ - __pyx_t_15 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; __Pyx_GIVEREF(__pyx_t_15); __pyx_cur_scope->__pyx_v_f_syms = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1197 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1183 * stats = self.online_stats[ctx_name] * f_syms = tuple(word[0][0] for word in fwords) * for f, lex_i, lex_j in self.get_f_phrases(f_syms): # <<<<<<<<<<<<<< * spanlen = (lex_j - lex_i) + 1 * if not sym_isvar(f[0]): */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms)); PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_f_syms)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms)); - __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; @@ -52379,7 +51793,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_16 = __pyx_t_8; __Pyx_INCREF(__pyx_t_16); __pyx_t_2 = 0; __pyx_t_22 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __pyx_t_22 = Py_TYPE(__pyx_t_16)->tp_iternext; } @@ -52388,23 +51802,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_16)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_16)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_16)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_16)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_8 = __pyx_t_22(__pyx_t_16); if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -52420,7 +51834,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -52436,18 +51850,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_18); #else - __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_10)->tp_iternext; @@ -52457,7 +51871,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_18 = __pyx_t_20(__pyx_t_10); if (unlikely(!__pyx_t_18)) goto __pyx_L75_unpacking_failed; __Pyx_GOTREF(__pyx_t_18); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L76_unpacking_done; @@ -52465,7 +51879,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L76_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); @@ -52481,16 +51895,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1198 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1184 * f_syms = tuple(word[0][0] for word in fwords) * for f, lex_i, lex_j in self.get_f_phrases(f_syms): * spanlen = (lex_j - lex_i) + 1 # <<<<<<<<<<<<<< * if not sym_isvar(f[0]): * spanlen += 1 */ - __pyx_t_8 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_18 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen); @@ -52498,28 +51912,28 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1199 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1185 * for f, lex_i, lex_j in self.get_f_phrases(f_syms): * spanlen = (lex_j - lex_i) + 1 * if not sym_isvar(f[0]): # <<<<<<<<<<<<<< * spanlen += 1 * if not sym_isvar(f[1]): */ - __pyx_t_18 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_9 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_7) != 0)) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1200 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1186 * spanlen = (lex_j - lex_i) + 1 * if not sym_isvar(f[0]): * spanlen += 1 # <<<<<<<<<<<<<< * if not sym_isvar(f[1]): * spanlen += 1 */ - __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_18); @@ -52529,28 +51943,28 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L77:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1201 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1187 * if not sym_isvar(f[0]): * spanlen += 1 * if not sym_isvar(f[1]): # <<<<<<<<<<<<<< * spanlen += 1 * for e in stats.phrases_fe.get(f, ()): */ - __pyx_t_18 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_9 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_7) != 0)) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1202 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1188 * spanlen += 1 * if not sym_isvar(f[1]): * spanlen += 1 # <<<<<<<<<<<<<< * for e in stats.phrases_fe.get(f, ()): * if (f, e) not in seen_phrases: */ - __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_18); @@ -52560,19 +51974,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L78:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1203 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1189 * if not sym_isvar(f[1]): * spanlen += 1 * for e in stats.phrases_fe.get(f, ()): # <<<<<<<<<<<<<< * if (f, e) not in seen_phrases: * # Don't add multiple instances of the same phrase here */ - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__get); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__get); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_cur_scope->__pyx_v_f); @@ -52580,7 +51994,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; @@ -52588,7 +52002,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_18 = __pyx_t_3; __Pyx_INCREF(__pyx_t_18); __pyx_t_23 = 0; __pyx_t_29 = NULL; } else { - __pyx_t_23 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __pyx_t_29 = Py_TYPE(__pyx_t_18)->tp_iternext; } @@ -52597,23 +52011,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (!__pyx_t_29 && PyList_CheckExact(__pyx_t_18)) { if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_18)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_18, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_18, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_29 && PyTuple_CheckExact(__pyx_t_18)) { if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_18)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_18, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_18, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_3 = __pyx_t_29(__pyx_t_18); if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -52624,14 +52038,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1204 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1190 * spanlen += 1 * for e in stats.phrases_fe.get(f, ()): * if (f, e) not in seen_phrases: # <<<<<<<<<<<<<< * # Don't add multiple instances of the same phrase here * seen_phrases.add((f, e)) */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f); @@ -52639,19 +52053,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(__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_t_9 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_14 = (__pyx_t_9 != 0); if (__pyx_t_14) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1206 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1192 * if (f, e) not in seen_phrases: * # Don't add multiple instances of the same phrase here * seen_phrases.add((f, e)) # <<<<<<<<<<<<<< * scores = self.scorer.score(FeatureContext( * f, e, 0, 0, 0, */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f); @@ -52659,29 +52073,29 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(__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_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1207 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1193 * # Don't add multiple instances of the same phrase here * seen_phrases.add((f, e)) * scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<< * f, e, 0, 0, 0, * spanlen, None, None, */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1212 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1198 * fwords, self.fda, self.eda, * meta, * self.online_ctx_lookup(f, e, ctx_name))) # <<<<<<<<<<<<<< * alignment = stats.phrases_al[f][e] * yield Rule(self.category, f, e, scores, alignment) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __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); @@ -52692,11 +52106,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ctx_name); PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_cur_scope->__pyx_v_ctx_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ctx_name); - __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(13); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(13); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __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); @@ -52737,11 +52151,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( PyTuple_SET_ITEM(__pyx_t_15, 12, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __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_15)); __pyx_t_15 = 0; - __pyx_t_15 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_10)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_10)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); @@ -52749,19 +52163,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1213 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1199 * meta, * self.online_ctx_lookup(f, e, ctx_name))) * alignment = stats.phrases_al[f][e] # <<<<<<<<<<<<<< * yield Rule(self.category, f, e, scores, alignment) * */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __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_f); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __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_e); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __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_alignment); @@ -52769,16 +52183,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1214 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1200 * self.online_ctx_lookup(f, e, ctx_name))) * alignment = stats.phrases_al[f][e] * yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<< * * stop_time = monitor_cpu() */ - __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __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); @@ -52795,7 +52209,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_cur_scope->__pyx_v_alignment); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __pyx_r = __pyx_t_15; @@ -52824,7 +52238,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_22 = __pyx_cur_scope->__pyx_t_10; __pyx_t_23 = __pyx_cur_scope->__pyx_t_1; __pyx_t_29 = __pyx_cur_scope->__pyx_t_11; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L81; } __pyx_L81:; @@ -52836,40 +52250,40 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L72:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1216 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1202 * yield Rule(self.category, f, e, scores, alignment) * * stop_time = monitor_cpu() # <<<<<<<<<<<<<< * logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time)) * gc.collect() */ - __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_18 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_18; __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1217 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1203 * * 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_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__info); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__info); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_15 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_18); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_18); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_INCREF(((PyObject *)__pyx_kp_s_130)); PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_kp_s_130)); @@ -52877,44 +52291,44 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1218 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1204 * 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) * logger.info(" Intersect time = %f seconds", self.intersect_time) */ - __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__gc); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__gc); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__collect); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__collect); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1219 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1205 * 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) # <<<<<<<<<<<<<< * logger.info(" Intersect time = %f seconds", self.intersect_time) * */ - __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(((PyObject *)__pyx_kp_s_131)); PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_kp_s_131)); @@ -52922,27 +52336,27 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1220 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1206 * gc.collect() * logger.info(" Extract time = %f seconds", self.extract_time) * logger.info(" Intersect time = %f seconds", self.intersect_time) # <<<<<<<<<<<<<< * * */ - __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_INCREF(((PyObject *)__pyx_kp_s_132)); PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_kp_s_132)); @@ -52950,7 +52364,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; @@ -52978,7 +52392,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1223 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1209 * * * cdef int find_fixpoint(self, # <<<<<<<<<<<<<< @@ -53008,7 +52422,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_fixpoint", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1238 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1224 * 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 # <<<<<<<<<<<<<< @@ -53017,7 +52431,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_e_low[0]) = __pyx_v_e_in_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1239 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1225 * * e_low[0] = e_in_low * e_high[0] = e_in_high # <<<<<<<<<<<<<< @@ -53026,19 +52440,19 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_e_high[0]) = __pyx_v_e_in_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1240 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1226 * 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 = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1240; __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 = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1241 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1227 * 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: # <<<<<<<<<<<<<< @@ -53048,7 +52462,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_3 = (((__pyx_v_e_low[0]) == -1) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1247 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1233 * # rule X -> X_1 w X_2 / X_1 X_2. This is probably * # not worth the bother, though. * return 0 # <<<<<<<<<<<<<< @@ -53060,7 +52474,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1248 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1234 * # not worth the bother, though. * return 0 * elif e_in_low != -1 and e_low[0] != e_in_low: # <<<<<<<<<<<<<< @@ -53076,7 +52490,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1249 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1235 * return 0 * elif e_in_low != -1 and e_low[0] != e_in_low: * if e_in_low - e_low[0] < min_ex_size: # <<<<<<<<<<<<<< @@ -53086,7 +52500,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_5 = (((__pyx_v_e_in_low - (__pyx_v_e_low[0])) < __pyx_v_min_ex_size) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1250 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1236 * 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 # <<<<<<<<<<<<<< @@ -53095,7 +52509,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_e_low[0]) = (__pyx_v_e_in_low - __pyx_v_min_ex_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1251 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1237 * if e_in_low - e_low[0] < min_ex_size: * e_low[0] = e_in_low - min_ex_size * if e_low[0] < 0: # <<<<<<<<<<<<<< @@ -53105,7 +52519,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_5 = (((__pyx_v_e_low[0]) < 0) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1252 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1238 * e_low[0] = e_in_low - min_ex_size * if e_low[0] < 0: * return 0 # <<<<<<<<<<<<<< @@ -53124,7 +52538,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1254 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1240 * return 0 * * if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<< @@ -53134,7 +52548,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_5 = ((((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1255 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1241 * * if e_high[0] - e_low[0] > max_e_len: * return 0 # <<<<<<<<<<<<<< @@ -53146,7 +52560,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct goto __pyx_L6; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1256 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1242 * if e_high[0] - e_low[0] > max_e_len: * return 0 * elif e_in_high != -1 and e_high[0] != e_in_high: # <<<<<<<<<<<<<< @@ -53162,7 +52576,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1257 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1243 * return 0 * elif e_in_high != -1 and e_high[0] != e_in_high: * if e_high[0] - e_in_high < min_ex_size: # <<<<<<<<<<<<<< @@ -53172,7 +52586,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((((__pyx_v_e_high[0]) - __pyx_v_e_in_high) < __pyx_v_min_ex_size) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1258 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1244 * 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 # <<<<<<<<<<<<<< @@ -53181,7 +52595,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_e_high[0]) = (__pyx_v_e_in_high + __pyx_v_min_ex_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1259 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1245 * 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: # <<<<<<<<<<<<<< @@ -53191,7 +52605,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_e_high[0]) > __pyx_v_e_sent_len) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1260 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1246 * e_high[0] = e_in_high + min_ex_size * if e_high[0] > e_sent_len: * return 0 # <<<<<<<<<<<<<< @@ -53210,7 +52624,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1262 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1248 * return 0 * * f_back_low[0] = -1 # <<<<<<<<<<<<<< @@ -53219,7 +52633,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_f_back_low[0]) = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1263 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1249 * * f_back_low[0] = -1 * f_back_high[0] = -1 # <<<<<<<<<<<<<< @@ -53228,7 +52642,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_f_back_high[0]) = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1264 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1250 * f_back_low[0] = -1 * f_back_high[0] = -1 * f_low_prev = f_low # <<<<<<<<<<<<<< @@ -53237,17 +52651,17 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_f_low_prev = __pyx_v_f_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1265 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1251 * 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 = 1265; __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 = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f_high_prev = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1266 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1252 * f_low_prev = f_low * f_high_prev = f_high * new_x = 0 # <<<<<<<<<<<<<< @@ -53256,7 +52670,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_x = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1267 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1253 * f_high_prev = f_high * new_x = 0 * new_low_x = 0 # <<<<<<<<<<<<<< @@ -53265,7 +52679,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_low_x = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1268 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1254 * new_x = 0 * new_low_x = 0 * new_high_x = 0 # <<<<<<<<<<<<<< @@ -53274,7 +52688,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_high_x = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1270 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1256 * new_high_x = 0 * * while True: # <<<<<<<<<<<<<< @@ -53284,7 +52698,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct while (1) { if (!1) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1272 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1258 * while True: * * if f_back_low[0] == -1: # <<<<<<<<<<<<<< @@ -53294,45 +52708,45 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_f_back_low[0]) == -1) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1273 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1259 * * 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_4cdec_2sa_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 = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1259; __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*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1275 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1261 * 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_4cdec_2sa_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 = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1276 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1262 * 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_4cdec_2sa_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 = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L11:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1278 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1264 * 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: # <<<<<<<<<<<<<< @@ -53342,7 +52756,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_f_back_low[0]) > __pyx_v_f_low) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1279 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1265 * * if f_back_low[0] > f_low: * f_back_low[0] = f_low # <<<<<<<<<<<<<< @@ -53354,35 +52768,35 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L12:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1281 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1267 * 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 = 1281; __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 = 1267; __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); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 1281; __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 = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1282 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1268 * * 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 = 1282; __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 = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_f_back_high[0]) = __pyx_t_1; goto __pyx_L13; } __pyx_L13:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1284 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1270 * f_back_high[0] = f_high * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: # <<<<<<<<<<<<<< @@ -53398,7 +52812,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1285 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1271 * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: * return 1 # <<<<<<<<<<<<<< @@ -53411,7 +52825,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L14:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1287 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1273 * return 1 * * if allow_low_x == 0 and f_back_low[0] < f_low: # <<<<<<<<<<<<<< @@ -53427,7 +52841,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1289 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1275 * if allow_low_x == 0 and f_back_low[0] < f_low: * # FAIL: f phrase is not tight * return 0 # <<<<<<<<<<<<<< @@ -53440,7 +52854,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L15:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1291 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1277 * return 0 * * if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<< @@ -53450,7 +52864,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_5 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1293 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1279 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: f back projection is too wide * return 0 # <<<<<<<<<<<<<< @@ -53463,7 +52877,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L16:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1295 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1281 * return 0 * * if allow_high_x == 0 and f_back_high[0] > f_high: # <<<<<<<<<<<<<< @@ -53472,11 +52886,11 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __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 = 1295; __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 = 1281; __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); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 1295; __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 = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_3; } else { @@ -53484,7 +52898,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1297 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1283 * if allow_high_x == 0 and f_back_high[0] > f_high: * # FAIL: extension on high side not allowed * return 0 # <<<<<<<<<<<<<< @@ -53497,7 +52911,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L17:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1299 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1285 * return 0 * * if f_low != f_back_low[0]: # <<<<<<<<<<<<<< @@ -53507,7 +52921,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((__pyx_v_f_low != (__pyx_v_f_back_low[0])) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1300 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1286 * * if f_low != f_back_low[0]: * if new_low_x == 0: # <<<<<<<<<<<<<< @@ -53517,7 +52931,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((__pyx_v_new_low_x == 0) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1301 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1287 * if f_low != f_back_low[0]: * if new_low_x == 0: * if new_x >= max_new_x: # <<<<<<<<<<<<<< @@ -53527,7 +52941,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((__pyx_v_new_x >= __pyx_v_max_new_x) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1303 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1289 * if new_x >= max_new_x: * # FAIL: extension required on low side violates max # of gaps * return 0 # <<<<<<<<<<<<<< @@ -53540,7 +52954,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1305 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1291 * return 0 * else: * new_x = new_x + 1 # <<<<<<<<<<<<<< @@ -53549,7 +52963,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_x = (__pyx_v_new_x + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1306 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1292 * else: * new_x = new_x + 1 * new_low_x = 1 # <<<<<<<<<<<<<< @@ -53563,7 +52977,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L19:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1307 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1293 * new_x = new_x + 1 * new_low_x = 1 * if f_low - f_back_low[0] < min_fx_size: # <<<<<<<<<<<<<< @@ -53573,7 +52987,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_f_low - (__pyx_v_f_back_low[0])) < __pyx_v_min_fx_size) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1308 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1294 * new_low_x = 1 * if f_low - f_back_low[0] < min_fx_size: * f_back_low[0] = f_low - min_fx_size # <<<<<<<<<<<<<< @@ -53582,7 +52996,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_f_back_low[0]) = (__pyx_v_f_low - __pyx_v_min_fx_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1309 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1295 * 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: # <<<<<<<<<<<<<< @@ -53592,7 +53006,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1311 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1297 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on low side violates max initial length * return 0 # <<<<<<<<<<<<<< @@ -53605,7 +53019,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L22:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1312 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1298 * # FAIL: extension required on low side violates max initial length * return 0 * if f_back_low[0] < 0: # <<<<<<<<<<<<<< @@ -53615,7 +53029,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_f_back_low[0]) < 0) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1314 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1300 * if f_back_low[0] < 0: * # FAIL: extension required on low side violates sentence boundary * return 0 # <<<<<<<<<<<<<< @@ -53634,22 +53048,22 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L18:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1316 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1302 * 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 = 1316; __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 = 1302; __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); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 1316; __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 = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1317 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1303 * * if f_high != f_back_high[0]: * if new_high_x == 0: # <<<<<<<<<<<<<< @@ -53659,7 +53073,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((__pyx_v_new_high_x == 0) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1318 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1304 * if f_high != f_back_high[0]: * if new_high_x == 0: * if new_x >= max_new_x: # <<<<<<<<<<<<<< @@ -53669,7 +53083,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((__pyx_v_new_x >= __pyx_v_max_new_x) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1320 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1306 * if new_x >= max_new_x: * # FAIL: extension required on high side violates max # of gaps * return 0 # <<<<<<<<<<<<<< @@ -53682,7 +53096,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1322 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1308 * return 0 * else: * new_x = new_x + 1 # <<<<<<<<<<<<<< @@ -53691,7 +53105,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_x = (__pyx_v_new_x + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1323 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1309 * else: * new_x = new_x + 1 * new_high_x = 1 # <<<<<<<<<<<<<< @@ -53705,44 +53119,44 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L25:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1324 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1310 * 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 = 1324; __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 = 1310; __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 = 1324; __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 = 1310; __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 = 1324; __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 = 1310; __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); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 1324; __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 = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1325 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1311 * 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 = 1325; __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 = 1311; __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 = 1325; __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 = 1311; __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 = 1325; __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 = 1311; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1326 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1312 * 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: # <<<<<<<<<<<<<< @@ -53752,7 +53166,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1328 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1314 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on high side violates max initial length * return 0 # <<<<<<<<<<<<<< @@ -53765,7 +53179,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L28:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1329 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1315 * # FAIL: extension required on high side violates max initial length * return 0 * if f_back_high[0] > f_sent_len: # <<<<<<<<<<<<<< @@ -53775,7 +53189,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_f_back_high[0]) > __pyx_v_f_sent_len) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1331 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1317 * if f_back_high[0] > f_sent_len: * # FAIL: extension required on high side violates sentence boundary * return 0 # <<<<<<<<<<<<<< @@ -53794,7 +53208,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1333 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1319 * return 0 * * e_low_prev = e_low[0] # <<<<<<<<<<<<<< @@ -53803,7 +53217,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_e_low_prev = (__pyx_v_e_low[0]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1334 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1320 * * e_low_prev = e_low[0] * e_high_prev = e_high[0] # <<<<<<<<<<<<<< @@ -53812,29 +53226,29 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_e_high_prev = (__pyx_v_e_high[0]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1336 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1322 * 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_4cdec_2sa_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 = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1337 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1323 * * 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_4cdec_2sa_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 = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1338 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1324 * 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: # <<<<<<<<<<<<<< @@ -53850,7 +53264,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1339 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1325 * 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 # <<<<<<<<<<<<<< @@ -53863,7 +53277,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L30:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1340 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1326 * if e_low[0] == e_low_prev and e_high[0] == e_high_prev: * return 1 * if allow_arbitrary_x == 0: # <<<<<<<<<<<<<< @@ -53873,7 +53287,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_3 = ((__pyx_v_allow_arbitrary_x == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1342 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1328 * if allow_arbitrary_x == 0: * # FAIL: arbitrary expansion not permitted * return 0 # <<<<<<<<<<<<<< @@ -53886,7 +53300,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L31:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1343 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1329 * # FAIL: arbitrary expansion not permitted * return 0 * if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<< @@ -53896,7 +53310,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_3 = ((((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1345 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1331 * if e_high[0] - e_low[0] > max_e_len: * # FAIL: re-projection violates sentence max phrase length * return 0 # <<<<<<<<<<<<<< @@ -53909,7 +53323,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L32:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1346 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1332 * # FAIL: re-projection violates sentence max phrase length * return 0 * f_low_prev = f_back_low[0] # <<<<<<<<<<<<<< @@ -53918,7 +53332,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_f_low_prev = (__pyx_v_f_back_low[0]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1347 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1333 * return 0 * f_low_prev = f_back_low[0] * f_high_prev = f_back_high[0] # <<<<<<<<<<<<<< @@ -53941,7 +53355,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1350 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1336 * * * cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<< @@ -53959,7 +53373,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio int __pyx_t_4; __Pyx_RefNannySetupContext("find_projection", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1353 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1339 * int* out_low, int* out_high): * cdef int i * for i from in_low <= i < in_high: # <<<<<<<<<<<<<< @@ -53969,7 +53383,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio __pyx_t_1 = __pyx_v_in_high; for (__pyx_v_i = __pyx_v_in_low; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1354 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1340 * cdef int i * for i from in_low <= i < in_high: * if in_links_low[i] != -1: # <<<<<<<<<<<<<< @@ -53979,7 +53393,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio __pyx_t_2 = (((__pyx_v_in_links_low[__pyx_v_i]) != -1) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1355 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1341 * 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]: # <<<<<<<<<<<<<< @@ -53995,7 +53409,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio } if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1356 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1342 * 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] # <<<<<<<<<<<<<< @@ -54007,7 +53421,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1357 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1343 * 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]: # <<<<<<<<<<<<<< @@ -54023,7 +53437,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1358 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1344 * 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] # <<<<<<<<<<<<<< @@ -54045,7 +53459,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1361 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1347 * * * cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<< @@ -54059,7 +53473,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("int_arr_extend", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1363 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1349 * 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 # <<<<<<<<<<<<<< @@ -54068,7 +53482,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH */ __pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_data_len); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1364 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1350 * cdef int new_len * new_len = arr_len[0] + data_len * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -54077,7 +53491,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1365 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1351 * new_len = arr_len[0] + data_len * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -54086,7 +53500,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH */ memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_data, (__pyx_v_data_len * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1366 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1352 * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) * arr_len[0] = new_len # <<<<<<<<<<<<<< @@ -54095,7 +53509,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH */ (__pyx_v_arr_len[0]) = __pyx_v_new_len; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1367 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1353 * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) * arr_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -54111,7 +53525,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1370 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1356 * * * 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, # <<<<<<<<<<<<<< @@ -54156,19 +53570,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract_phrases", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1378 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1364 * cdef result * * result = [] # <<<<<<<<<<<<<< * len1 = 0 * e_gaps1 = malloc(0) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1378; __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 = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1379 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1365 * * result = [] * len1 = 0 # <<<<<<<<<<<<<< @@ -54177,7 +53591,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_len1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1380 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1366 * result = [] * len1 = 0 * e_gaps1 = malloc(0) # <<<<<<<<<<<<<< @@ -54186,19 +53600,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps1 = ((int *)malloc(0)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1381 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1367 * len1 = 0 * e_gaps1 = malloc(0) * ephr_arr = IntList() # <<<<<<<<<<<<<< * * e_gap_order = malloc(num_gaps*sizeof(int)) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); 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_v_ephr_arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1383 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1369 * ephr_arr = IntList() * * e_gap_order = malloc(num_gaps*sizeof(int)) # <<<<<<<<<<<<<< @@ -54207,7 +53621,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gap_order = ((int *)malloc((__pyx_v_num_gaps * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1384 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1370 * * e_gap_order = malloc(num_gaps*sizeof(int)) * if num_gaps > 0: # <<<<<<<<<<<<<< @@ -54217,7 +53631,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = ((__pyx_v_num_gaps > 0) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1385 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1371 * e_gap_order = malloc(num_gaps*sizeof(int)) * if num_gaps > 0: * e_gap_order[0] = 0 # <<<<<<<<<<<<<< @@ -54226,7 +53640,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ (__pyx_v_e_gap_order[0]) = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1386 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1372 * if num_gaps > 0: * e_gap_order[0] = 0 * for i from 1 <= i < num_gaps: # <<<<<<<<<<<<<< @@ -54236,7 +53650,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1387 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1373 * e_gap_order[0] = 0 * for i from 1 <= i < num_gaps: * for j from 0 <= j < i: # <<<<<<<<<<<<<< @@ -54246,7 +53660,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_4 = __pyx_v_i; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1388 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1374 * for i from 1 <= i < num_gaps: * for j from 0 <= j < i: * if e_gap_low[i] < e_gap_low[j]: # <<<<<<<<<<<<<< @@ -54256,7 +53670,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = (((__pyx_v_e_gap_low[__pyx_v_i]) < (__pyx_v_e_gap_low[__pyx_v_j])) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1389 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1375 * for j from 0 <= j < i: * if e_gap_low[i] < e_gap_low[j]: * for k from j <= k < i: # <<<<<<<<<<<<<< @@ -54266,7 +53680,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_5 = __pyx_v_i; for (__pyx_v_k = __pyx_v_j; __pyx_v_k < __pyx_t_5; __pyx_v_k++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1390 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1376 * if e_gap_low[i] < e_gap_low[j]: * for k from j <= k < i: * e_gap_order[k+1] = e_gap_order[k] # <<<<<<<<<<<<<< @@ -54276,7 +53690,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase (__pyx_v_e_gap_order[(__pyx_v_k + 1)]) = (__pyx_v_e_gap_order[__pyx_v_k]); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1391 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1377 * for k from j <= k < i: * e_gap_order[k+1] = e_gap_order[k] * e_gap_order[j] = i # <<<<<<<<<<<<<< @@ -54285,7 +53699,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ (__pyx_v_e_gap_order[__pyx_v_j]) = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1392 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1378 * e_gap_order[k+1] = e_gap_order[k] * e_gap_order[j] = i * break # <<<<<<<<<<<<<< @@ -54299,7 +53713,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1394 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1380 * break * else: * e_gap_order[i] = i # <<<<<<<<<<<<<< @@ -54314,7 +53728,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1396 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1382 * e_gap_order[i] = i * * e_x_low = e_low # <<<<<<<<<<<<<< @@ -54323,7 +53737,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_x_low = __pyx_v_e_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1397 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1383 * * e_x_low = e_low * e_x_high = e_high # <<<<<<<<<<<<<< @@ -54332,7 +53746,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_x_high = __pyx_v_e_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1398 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1384 * e_x_low = e_low * e_x_high = e_high * if not self.tight_phrases: # <<<<<<<<<<<<<< @@ -54342,7 +53756,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = ((!(__pyx_v_self->tight_phrases != 0)) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1399 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1385 * e_x_high = e_high * if not self.tight_phrases: * 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: # <<<<<<<<<<<<<< @@ -54365,7 +53779,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (!__pyx_t_6) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1400 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1386 * if not self.tight_phrases: * 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 # <<<<<<<<<<<<<< @@ -54375,7 +53789,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_v_e_x_low = (__pyx_v_e_x_low - 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1401 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1387 * 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: # <<<<<<<<<<<<<< @@ -54398,7 +53812,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1402 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1388 * 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 # <<<<<<<<<<<<<< @@ -54411,7 +53825,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } __pyx_L11:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1404 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1390 * e_x_high = e_x_high + 1 * * for i from e_x_low <= i <= e_low: # <<<<<<<<<<<<<< @@ -54421,7 +53835,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1405 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1391 * * for i from e_x_low <= i <= e_low: * e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) # <<<<<<<<<<<<<< @@ -54431,7 +53845,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_v_e_gaps1 = ((struct __pyx_vtabstruct_4cdec_2sa_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); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1407 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1393 * e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) * * for i from 0 <= i < num_gaps: # <<<<<<<<<<<<<< @@ -54441,7 +53855,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1408 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1394 * * for i from 0 <= i < num_gaps: * e_gaps2 = malloc(0) # <<<<<<<<<<<<<< @@ -54450,7 +53864,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps2 = ((int *)malloc(0)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1409 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1395 * for i from 0 <= i < num_gaps: * e_gaps2 = malloc(0) * len2 = 0 # <<<<<<<<<<<<<< @@ -54459,7 +53873,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_len2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1411 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1397 * len2 = 0 * * j = e_gap_order[i] # <<<<<<<<<<<<<< @@ -54468,7 +53882,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_j = (__pyx_v_e_gap_order[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1412 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1398 * * j = e_gap_order[i] * e_x_gap_low = e_gap_low[j] # <<<<<<<<<<<<<< @@ -54477,7 +53891,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_x_gap_low = (__pyx_v_e_gap_low[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1413 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1399 * j = e_gap_order[i] * e_x_gap_low = e_gap_low[j] * e_x_gap_high = e_gap_high[j] # <<<<<<<<<<<<<< @@ -54486,7 +53900,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_x_gap_high = (__pyx_v_e_gap_high[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1414 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1400 * e_x_gap_low = e_gap_low[j] * e_x_gap_high = e_gap_high[j] * if not self.tight_phrases: # <<<<<<<<<<<<<< @@ -54496,7 +53910,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = ((!(__pyx_v_self->tight_phrases != 0)) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1415 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1401 * e_x_gap_high = e_gap_high[j] * if not self.tight_phrases: * while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1: # <<<<<<<<<<<<<< @@ -54513,7 +53927,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1416 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1402 * if not self.tight_phrases: * 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 # <<<<<<<<<<<<<< @@ -54523,7 +53937,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_v_e_x_gap_low = (__pyx_v_e_x_gap_low - 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1417 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1403 * 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: # <<<<<<<<<<<<<< @@ -54540,7 +53954,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (!__pyx_t_6) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1418 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1404 * 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 # <<<<<<<<<<<<<< @@ -54553,7 +53967,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } __pyx_L20:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1420 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1406 * e_x_gap_high = e_x_gap_high + 1 * * k = 0 # <<<<<<<<<<<<<< @@ -54562,7 +53976,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_k = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1421 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1407 * * k = 0 * step = 1+(i*2) # <<<<<<<<<<<<<< @@ -54571,7 +53985,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_step = (1 + (__pyx_v_i * 2)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1422 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1408 * k = 0 * step = 1+(i*2) * while k < len1: # <<<<<<<<<<<<<< @@ -54582,7 +53996,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_6 = ((__pyx_v_k < __pyx_v_len1) != 0); if (!__pyx_t_6) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1423 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1409 * step = 1+(i*2) * while k < len1: * for m from e_x_gap_low <= m <= e_gap_low[j]: # <<<<<<<<<<<<<< @@ -54592,7 +54006,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1424 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1410 * while k < len1: * for m from e_x_gap_low <= m <= e_gap_low[j]: * if m >= e_gaps1[k+step-1]: # <<<<<<<<<<<<<< @@ -54602,7 +54016,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_6 = ((__pyx_v_m >= (__pyx_v_e_gaps1[((__pyx_v_k + __pyx_v_step) - 1)])) != 0); if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1425 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1411 * 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: # <<<<<<<<<<<<<< @@ -54612,7 +54026,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1426 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1412 * 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 # <<<<<<<<<<<<<< @@ -54622,7 +54036,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_6 = (((__pyx_v_n - __pyx_v_m) >= 1) != 0); if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1427 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1413 * 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) # <<<<<<<<<<<<<< @@ -54631,7 +54045,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1428 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1414 * 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) # <<<<<<<<<<<<<< @@ -54640,7 +54054,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1429 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1415 * 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) # <<<<<<<<<<<<<< @@ -54657,7 +54071,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_L29:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1430 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1416 * 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 # <<<<<<<<<<<<<< @@ -54667,7 +54081,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_v_k = (__pyx_v_k + __pyx_v_step); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1431 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1417 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) * k = k + step * free(e_gaps1) # <<<<<<<<<<<<<< @@ -54676,7 +54090,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ free(__pyx_v_e_gaps1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1432 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1418 * k = k + step * free(e_gaps1) * e_gaps1 = e_gaps2 # <<<<<<<<<<<<<< @@ -54685,7 +54099,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps1 = __pyx_v_e_gaps2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1433 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1419 * free(e_gaps1) * e_gaps1 = e_gaps2 * len1 = len2 # <<<<<<<<<<<<<< @@ -54695,7 +54109,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_v_len1 = __pyx_v_len2; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1435 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1421 * len1 = len2 * * step = 1+(num_gaps*2) # <<<<<<<<<<<<<< @@ -54704,7 +54118,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_step = (1 + (__pyx_v_num_gaps * 2)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1436 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1422 * * step = 1+(num_gaps*2) * e_gaps2 = malloc(0) # <<<<<<<<<<<<<< @@ -54713,7 +54127,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps2 = ((int *)malloc(0)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1437 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1423 * step = 1+(num_gaps*2) * e_gaps2 = malloc(0) * len2 = 0 # <<<<<<<<<<<<<< @@ -54722,7 +54136,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_len2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1438 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1424 * e_gaps2 = malloc(0) * len2 = 0 * for i from e_high <= i <= e_x_high: # <<<<<<<<<<<<<< @@ -54732,7 +54146,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1439 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1425 * len2 = 0 * for i from e_high <= i <= e_x_high: * j = 0 # <<<<<<<<<<<<<< @@ -54741,7 +54155,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_j = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1440 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1426 * for i from e_high <= i <= e_x_high: * j = 0 * while j < len1: # <<<<<<<<<<<<<< @@ -54752,7 +54166,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_6 = ((__pyx_v_j < __pyx_v_len1) != 0); if (!__pyx_t_6) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1441 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1427 * j = 0 * while j < len1: * if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: # <<<<<<<<<<<<<< @@ -54768,7 +54182,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1442 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1428 * 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) # <<<<<<<<<<<<<< @@ -54777,7 +54191,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1443 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1429 * 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) # <<<<<<<<<<<<<< @@ -54789,7 +54203,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } __pyx_L37:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1444 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1430 * 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 # <<<<<<<<<<<<<< @@ -54800,7 +54214,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1445 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1431 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1) * j = j + step * free(e_gaps1) # <<<<<<<<<<<<<< @@ -54809,7 +54223,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ free(__pyx_v_e_gaps1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1446 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1432 * j = j + step * free(e_gaps1) * e_gaps1 = e_gaps2 # <<<<<<<<<<<<<< @@ -54818,7 +54232,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps1 = __pyx_v_e_gaps2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1447 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1433 * free(e_gaps1) * e_gaps1 = e_gaps2 * len1 = len2 # <<<<<<<<<<<<<< @@ -54827,7 +54241,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_len1 = __pyx_v_len2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1449 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1435 * len1 = len2 * * step = (num_gaps+1)*2 # <<<<<<<<<<<<<< @@ -54836,7 +54250,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_step = ((__pyx_v_num_gaps + 1) * 2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1450 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1436 * * step = (num_gaps+1)*2 * i = 0 # <<<<<<<<<<<<<< @@ -54845,7 +54259,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_i = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1453 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1439 * * cdef IntList indexes * while i < len1: # <<<<<<<<<<<<<< @@ -54856,7 +54270,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = ((__pyx_v_i < __pyx_v_len1) != 0); if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1454 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1440 * cdef IntList indexes * while i < len1: * ephr_arr._clear() # <<<<<<<<<<<<<< @@ -54865,7 +54279,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_clear(__pyx_v_ephr_arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1455 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1441 * while i < len1: * ephr_arr._clear() * num_chunks = 0 # <<<<<<<<<<<<<< @@ -54874,19 +54288,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_num_chunks = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1456 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1442 * ephr_arr._clear() * num_chunks = 0 * indexes = IntList() # <<<<<<<<<<<<<< * for j from 0 <= j < num_gaps+1: * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_indexes, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1457 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1443 * num_chunks = 0 * indexes = IntList() * for j from 0 <= j < num_gaps+1: # <<<<<<<<<<<<<< @@ -54896,7 +54310,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_9 = (__pyx_v_num_gaps + 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1458 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1444 * indexes = IntList() * for j from 0 <= j < num_gaps+1: * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<< @@ -54906,7 +54320,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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)])) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1459 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1445 * 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 # <<<<<<<<<<<<<< @@ -54918,7 +54332,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } __pyx_L42:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1460 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1446 * 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]: # <<<<<<<<<<<<<< @@ -54928,21 +54342,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1461 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1447 * 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 = 1461; __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 = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1462 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1448 * 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]]) # <<<<<<<<<<<<<< @@ -54950,14 +54364,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase * 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_10 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_t_4); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1463 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1449 * indexes.append(k) * ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) * if j < num_gaps: # <<<<<<<<<<<<<< @@ -54967,21 +54381,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = ((__pyx_v_j < __pyx_v_num_gaps) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1464 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1450 * 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_10 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1450; __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_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1465 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1451 * 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)) # <<<<<<<<<<<<<< @@ -54994,7 +54408,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_L45:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1466 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1452 * 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 # <<<<<<<<<<<<<< @@ -55003,7 +54417,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_i = (__pyx_v_i + __pyx_v_step); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1467 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1453 * 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: # <<<<<<<<<<<<<< @@ -55019,22 +54433,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1468 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1454 * 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 = 1468; __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 = 1454; __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_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __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 = 1468; __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 = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -55042,7 +54456,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indexes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_indexes)); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -55051,7 +54465,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_L46:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1470 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1456 * result.append((Phrase(ephr_arr),indexes)) * * free(e_gaps1) # <<<<<<<<<<<<<< @@ -55060,7 +54474,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ free(__pyx_v_e_gaps1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1471 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1457 * * free(e_gaps1) * free(e_gap_order) # <<<<<<<<<<<<<< @@ -55069,7 +54483,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ free(__pyx_v_e_gap_order); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1472 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1458 * free(e_gaps1) * free(e_gap_order) * return result # <<<<<<<<<<<<<< @@ -55097,7 +54511,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1474 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1460 * return result * * cdef IntList create_alignments(self, int* sent_links, int num_links, # <<<<<<<<<<<<<< @@ -55125,19 +54539,19 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_alignments", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1477 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1463 * IntList findexes, IntList eindexes): * cdef unsigned i * cdef IntList ret = IntList() # <<<<<<<<<<<<<< * for i in range(findexes.len): * s = findexes.arr[i] */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1478 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1464 * cdef unsigned i * cdef IntList ret = IntList() * for i in range(findexes.len): # <<<<<<<<<<<<<< @@ -55148,7 +54562,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1479 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1465 * cdef IntList ret = IntList() * for i in range(findexes.len): * s = findexes.arr[i] # <<<<<<<<<<<<<< @@ -55157,7 +54571,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa */ __pyx_v_s = (__pyx_v_findexes->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1480 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1466 * for i in range(findexes.len): * s = findexes.arr[i] * if s < 0: continue # <<<<<<<<<<<<<< @@ -55171,7 +54585,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1481 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1467 * s = findexes.arr[i] * if s < 0: continue * idx = 0 # <<<<<<<<<<<<<< @@ -55181,7 +54595,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1482 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1468 * if s < 0: continue * idx = 0 * while idx < num_links * 2: # <<<<<<<<<<<<<< @@ -55189,65 +54603,65 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa * 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 = 1482; __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 = 1468; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 1482; __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 = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_4) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1483 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1469 * idx = 0 * while idx < num_links * 2: * if sent_links[idx] == s: # <<<<<<<<<<<<<< * j = eindexes.index(sent_links[idx+1]) * ret.append(i * ALIGNMENT_CODE + 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 = 1483; __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 = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (((__pyx_v_sent_links[__pyx_t_6]) == __pyx_v_s) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1484 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1470 * while idx < num_links * 2: * if sent_links[idx] == s: * j = eindexes.index(sent_links[idx+1]) # <<<<<<<<<<<<<< * ret.append(i * ALIGNMENT_CODE + j) * idx += 2 */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_eindexes), __pyx_n_s__index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_eindexes), __pyx_n_s__index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __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 = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1485 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1471 * if sent_links[idx] == s: * j = eindexes.index(sent_links[idx+1]) * ret.append(i * ALIGNMENT_CODE + j) # <<<<<<<<<<<<<< * idx += 2 * return ret */ - __pyx_t_1 = PyLong_FromUnsignedLong((__pyx_v_i * __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyLong_FromUnsignedLong((__pyx_v_i * __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -55255,14 +54669,14 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1486 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1472 * j = eindexes.index(sent_links[idx+1]) * ret.append(i * ALIGNMENT_CODE + j) * idx += 2 # <<<<<<<<<<<<<< * return ret * */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_1); __pyx_t_1 = 0; @@ -55270,7 +54684,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa __pyx_L3_continue:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1487 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1473 * ret.append(i * ALIGNMENT_CODE + j) * idx += 2 * return ret # <<<<<<<<<<<<<< @@ -55299,7 +54713,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1489 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1475 * return ret * * cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<< @@ -55393,19 +54807,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1502 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1488 * cdef reason_for_failure * * fphr_arr = IntList() # <<<<<<<<<<<<<< * phrase_len = phrase.n * extracts = [] */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_fphr_arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1503 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1489 * * fphr_arr = IntList() * phrase_len = phrase.n # <<<<<<<<<<<<<< @@ -55415,19 +54829,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_phrase->n; __pyx_v_phrase_len = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1504 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1490 * 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 = 1504; __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 = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_extracts = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1505 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1491 * phrase_len = phrase.n * extracts = [] * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) # <<<<<<<<<<<<<< @@ -55436,7 +54850,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_sent_links = ((struct __pyx_vtabstruct_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1507 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1493 * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<< @@ -55445,7 +54859,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_sent_start = (__pyx_v_self->eda->sent_index->arr[__pyx_v_matching->sent_id]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1508 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1494 * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] * e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<< @@ -55454,7 +54868,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_sent_end = (__pyx_v_self->eda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1509 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1495 * 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 # <<<<<<<<<<<<<< @@ -55463,7 +54877,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_sent_len = ((__pyx_v_e_sent_end - __pyx_v_e_sent_start) - 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1510 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1496 * 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] # <<<<<<<<<<<<<< @@ -55472,7 +54886,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_sent_start = (__pyx_v_self->fda->sent_index->arr[__pyx_v_matching->sent_id]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1511 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1497 * 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] # <<<<<<<<<<<<<< @@ -55481,7 +54895,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_sent_end = (__pyx_v_self->fda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1512 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1498 * 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 # <<<<<<<<<<<<<< @@ -55490,21 +54904,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_sent_len = ((__pyx_v_f_sent_end - __pyx_v_f_sent_start) - 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1514 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1500 * f_sent_len = f_sent_end - f_sent_start - 1 * * self.findexes1.reset() # <<<<<<<<<<<<<< * sofar = 0 * for i in range(num_chunks): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1500; __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 = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1500; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1515 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1501 * * self.findexes1.reset() * sofar = 0 # <<<<<<<<<<<<<< @@ -55514,7 +54928,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(__pyx_int_0); __pyx_v_sofar = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1516 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1502 * self.findexes1.reset() * sofar = 0 * for i in range(num_chunks): # <<<<<<<<<<<<<< @@ -55525,7 +54939,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1517 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1503 * sofar = 0 * for i in range(num_chunks): * for j in range(chunklen[i]): # <<<<<<<<<<<<<< @@ -55536,34 +54950,34 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1518 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1504 * 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_3 = 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_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = 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_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1504; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1519 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1505 * 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 = 1519; __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 = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_sofar, __pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1520 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1506 * self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); * sofar += 1 * if i+1 < num_chunks: # <<<<<<<<<<<<<< @@ -55573,28 +54987,28 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_7 = (((__pyx_v_i + 1) < __pyx_v_num_chunks) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1521 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1507 * 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 = 1521; __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 = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1507; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1522 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1508 * if i+1 < num_chunks: * self.findexes1.append(phrase[sofar]) * sofar += 1 # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_sofar, __pyx_t_3); __pyx_t_3 = 0; @@ -55603,7 +55017,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L7:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1525 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1511 * * * e_links_low = malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -55612,7 +55026,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_links_low = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1526 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1512 * * e_links_low = malloc(e_sent_len*sizeof(int)) * e_links_high = malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -55621,7 +55035,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_links_high = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1527 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1513 * e_links_low = malloc(e_sent_len*sizeof(int)) * e_links_high = malloc(e_sent_len*sizeof(int)) * f_links_low = malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -55630,7 +55044,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_links_low = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1528 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1514 * e_links_high = malloc(e_sent_len*sizeof(int)) * f_links_low = malloc(f_sent_len*sizeof(int)) * f_links_high = malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -55639,7 +55053,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_links_high = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1529 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1515 * f_links_low = malloc(f_sent_len*sizeof(int)) * f_links_high = malloc(f_sent_len*sizeof(int)) * f_gap_low = malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -55648,7 +55062,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1530 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1516 * f_links_high = malloc(f_sent_len*sizeof(int)) * f_gap_low = malloc((num_chunks+1)*sizeof(int)) * f_gap_high = malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -55657,7 +55071,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1531 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1517 * f_gap_low = malloc((num_chunks+1)*sizeof(int)) * f_gap_high = malloc((num_chunks+1)*sizeof(int)) * e_gap_low = malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -55666,7 +55080,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1532 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1518 * f_gap_high = malloc((num_chunks+1)*sizeof(int)) * e_gap_low = malloc((num_chunks+1)*sizeof(int)) * e_gap_high = malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -55675,7 +55089,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1533 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1519 * e_gap_low = malloc((num_chunks+1)*sizeof(int)) * e_gap_high = malloc((num_chunks+1)*sizeof(int)) * memset(f_gap_low, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -55684,7 +55098,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ memset(__pyx_v_f_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1534 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1520 * e_gap_high = 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)) # <<<<<<<<<<<<<< @@ -55693,7 +55107,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ memset(__pyx_v_f_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1535 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1521 * 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)) # <<<<<<<<<<<<<< @@ -55702,7 +55116,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ memset(__pyx_v_e_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1536 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1522 * 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)) # <<<<<<<<<<<<<< @@ -55711,7 +55125,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ memset(__pyx_v_e_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1538 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1524 * memset(e_gap_high, 0, (num_chunks+1)*sizeof(int)) * * reason_for_failure = "" # <<<<<<<<<<<<<< @@ -55721,7 +55135,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(((PyObject *)__pyx_kp_s_47)); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_47); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1540 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1526 * reason_for_failure = "" * * for i from 0 <= i < e_sent_len: # <<<<<<<<<<<<<< @@ -55731,7 +55145,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_e_sent_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1541 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1527 * * for i from 0 <= i < e_sent_len: * e_links_low[i] = -1 # <<<<<<<<<<<<<< @@ -55740,7 +55154,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_e_links_low[__pyx_v_i]) = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1542 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1528 * for i from 0 <= i < e_sent_len: * e_links_low[i] = -1 * e_links_high[i] = -1 # <<<<<<<<<<<<<< @@ -55750,7 +55164,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct (__pyx_v_e_links_high[__pyx_v_i]) = -1; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1543 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1529 * e_links_low[i] = -1 * e_links_high[i] = -1 * for i from 0 <= i < f_sent_len: # <<<<<<<<<<<<<< @@ -55760,7 +55174,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_f_sent_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1544 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1530 * e_links_high[i] = -1 * for i from 0 <= i < f_sent_len: * f_links_low[i] = -1 # <<<<<<<<<<<<<< @@ -55769,7 +55183,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_f_links_low[__pyx_v_i]) = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1545 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1531 * for i from 0 <= i < f_sent_len: * f_links_low[i] = -1 * f_links_high[i] = -1 # <<<<<<<<<<<<<< @@ -55779,7 +55193,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct (__pyx_v_f_links_high[__pyx_v_i]) = -1; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1551 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1537 * # links that we care about (but then how to look up * # when we want to check something on the e side?) * i = 0 # <<<<<<<<<<<<<< @@ -55788,7 +55202,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1552 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1538 * # when we want to check something on the e side?) * i = 0 * while i < num_links*2: # <<<<<<<<<<<<<< @@ -55799,7 +55213,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_7 = ((__pyx_v_i < (__pyx_v_num_links * 2)) != 0); if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1553 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1539 * i = 0 * while i < num_links*2: * f_i = sent_links[i] # <<<<<<<<<<<<<< @@ -55808,7 +55222,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_i = (__pyx_v_sent_links[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1554 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1540 * while i < num_links*2: * f_i = sent_links[i] * e_i = sent_links[i+1] # <<<<<<<<<<<<<< @@ -55817,7 +55231,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_i = (__pyx_v_sent_links[(__pyx_v_i + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1555 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1541 * 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: # <<<<<<<<<<<<<< @@ -55833,7 +55247,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1556 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1542 * 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 # <<<<<<<<<<<<<< @@ -55845,7 +55259,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L14:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1557 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1543 * 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: # <<<<<<<<<<<<<< @@ -55861,7 +55275,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1558 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1544 * 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 # <<<<<<<<<<<<<< @@ -55873,7 +55287,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L15:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1559 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1545 * 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: # <<<<<<<<<<<<<< @@ -55889,7 +55303,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1560 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1546 * 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 # <<<<<<<<<<<<<< @@ -55901,7 +55315,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L16:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1561 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1547 * 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: # <<<<<<<<<<<<<< @@ -55917,7 +55331,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1562 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1548 * 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 # <<<<<<<<<<<<<< @@ -55929,7 +55343,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L17:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1563 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1549 * 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 # <<<<<<<<<<<<<< @@ -55939,19 +55353,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_v_i = (__pyx_v_i + 2); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1565 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1551 * 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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1565; __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 = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_als = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1566 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1552 * * als = [] * for x in range(matching.start,matching.end): # <<<<<<<<<<<<<< @@ -55962,18 +55376,18 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct for (__pyx_t_4 = __pyx_v_matching->start; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { __pyx_v_x = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1567 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1553 * 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_3 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __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 = 1567; __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 = 1553; __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 = 1567; __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 = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -55984,17 +55398,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_XDECREF_SET(__pyx_v_al, ((PyObject*)__pyx_t_10)); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1568 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1554 * 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 = __Pyx_PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1570 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1556 * als.append(al) * # check all source-side alignment constraints * met_constraints = 1 # <<<<<<<<<<<<<< @@ -56003,7 +55417,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1571 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1557 * # check all source-side alignment constraints * met_constraints = 1 * if self.require_aligned_terminal: # <<<<<<<<<<<<<< @@ -56013,7 +55427,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = (__pyx_v_self->require_aligned_terminal != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1572 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1558 * met_constraints = 1 * if self.require_aligned_terminal: * num_aligned_chunks = 0 # <<<<<<<<<<<<<< @@ -56022,7 +55436,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_num_aligned_chunks = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1573 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1559 * if self.require_aligned_terminal: * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: # <<<<<<<<<<<<<< @@ -56032,7 +55446,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_num_chunks; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1574 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1560 * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: * for j from 0 <= j < chunklen[i]: # <<<<<<<<<<<<<< @@ -56042,7 +55456,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_4 = (__pyx_v_chunklen[__pyx_v_i]); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1575 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1561 * 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: # <<<<<<<<<<<<<< @@ -56052,7 +55466,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1576 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1562 * 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 # <<<<<<<<<<<<<< @@ -56061,7 +55475,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_num_aligned_chunks = (__pyx_v_num_aligned_chunks + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1577 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1563 * if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1: * num_aligned_chunks = num_aligned_chunks + 1 * break # <<<<<<<<<<<<<< @@ -56076,7 +55490,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L24_break:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1578 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1564 * num_aligned_chunks = num_aligned_chunks + 1 * break * if num_aligned_chunks == 0: # <<<<<<<<<<<<<< @@ -56086,7 +55500,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_num_aligned_chunks == 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1579 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1565 * break * if num_aligned_chunks == 0: * reason_for_failure = "No aligned terminals" # <<<<<<<<<<<<<< @@ -56096,7 +55510,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(((PyObject *)__pyx_kp_s_133)); __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_133)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1580 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1566 * if num_aligned_chunks == 0: * reason_for_failure = "No aligned terminals" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -56108,7 +55522,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L26:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1581 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1567 * reason_for_failure = "No aligned terminals" * met_constraints = 0 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: # <<<<<<<<<<<<<< @@ -56123,7 +55537,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1582 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1568 * met_constraints = 0 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: * reason_for_failure = "Unaligned chunk" # <<<<<<<<<<<<<< @@ -56133,7 +55547,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(((PyObject *)__pyx_kp_s_134)); __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_134)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1583 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1569 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: * reason_for_failure = "Unaligned chunk" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -56148,7 +55562,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L20:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1585 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1571 * met_constraints = 0 * * if met_constraints and self.tight_phrases: # <<<<<<<<<<<<<< @@ -56163,7 +55577,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1587 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1573 * if met_constraints and self.tight_phrases: * # outside edge constraints are checked later * for i from 0 <= i < num_chunks-1: # <<<<<<<<<<<<<< @@ -56173,7 +55587,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_12 = (__pyx_v_num_chunks - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1588 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1574 * # 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: # <<<<<<<<<<<<<< @@ -56183,7 +55597,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = (((__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) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1589 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1575 * 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" # <<<<<<<<<<<<<< @@ -56193,7 +55607,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(((PyObject *)__pyx_kp_s_135)); __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_135)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1590 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1576 * 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 # <<<<<<<<<<<<<< @@ -56202,7 +55616,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1591 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1577 * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 * break # <<<<<<<<<<<<<< @@ -56214,7 +55628,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L31:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1592 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1578 * met_constraints = 0 * break * if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: # <<<<<<<<<<<<<< @@ -56224,7 +55638,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = (((__pyx_v_f_links_low[(((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - 1) - __pyx_v_f_sent_start)]) == -1) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1593 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1579 * break * if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: * reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<< @@ -56234,7 +55648,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(((PyObject *)__pyx_kp_s_135)); __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_135)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1594 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1580 * 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 # <<<<<<<<<<<<<< @@ -56243,7 +55657,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1595 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1581 * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 * break # <<<<<<<<<<<<<< @@ -56260,7 +55674,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L28:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1597 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1583 * break * * f_low = matching.arr[matching.start] - f_sent_start # <<<<<<<<<<<<<< @@ -56269,7 +55683,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_low = ((__pyx_v_matching->arr[__pyx_v_matching->start]) - __pyx_v_f_sent_start); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1598 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1584 * * 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 # <<<<<<<<<<<<<< @@ -56278,7 +55692,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1599 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1585 * 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: # <<<<<<<<<<<<<< @@ -56288,17 +55702,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = (__pyx_v_met_constraints != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1601 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1587 * 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 = 1601; __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 = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1605 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1591 * 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): # <<<<<<<<<<<<<< @@ -56309,7 +55723,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1606 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1592 * self.train_min_gap_size, 0, * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): * gap_error = 0 # <<<<<<<<<<<<<< @@ -56318,7 +55732,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_error = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1607 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1593 * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): * gap_error = 0 * num_gaps = 0 # <<<<<<<<<<<<<< @@ -56327,7 +55741,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_num_gaps = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1609 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1595 * num_gaps = 0 * * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -56337,7 +55751,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1610 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1596 * * if f_back_low < f_low: * f_gap_low[0] = f_back_low # <<<<<<<<<<<<<< @@ -56346,7 +55760,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_f_gap_low[0]) = __pyx_v_f_back_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1611 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1597 * if f_back_low < f_low: * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low # <<<<<<<<<<<<<< @@ -56355,7 +55769,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_f_gap_high[0]) = __pyx_v_f_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1612 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1598 * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low * num_gaps = 1 # <<<<<<<<<<<<<< @@ -56364,7 +55778,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_num_gaps = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1613 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1599 * f_gap_high[0] = f_low * num_gaps = 1 * gap_start = 0 # <<<<<<<<<<<<<< @@ -56373,7 +55787,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_start = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1614 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1600 * num_gaps = 1 * gap_start = 0 * phrase_len = phrase_len+1 # <<<<<<<<<<<<<< @@ -56382,7 +55796,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_phrase_len = (__pyx_v_phrase_len + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1615 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1601 * gap_start = 0 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: # <<<<<<<<<<<<<< @@ -56392,7 +55806,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_phrase_len > __pyx_v_self->max_length) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1616 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1602 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: * gap_error = 1 # <<<<<<<<<<<<<< @@ -56404,7 +55818,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L36:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1617 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1603 * if phrase_len > self.max_length: * gap_error = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -56414,7 +55828,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = (__pyx_v_self->tight_phrases != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1618 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1604 * gap_error = 1 * if self.tight_phrases: * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: # <<<<<<<<<<<<<< @@ -56430,7 +55844,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1619 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1605 * if self.tight_phrases: * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: * gap_error = 1 # <<<<<<<<<<<<<< @@ -56439,7 +55853,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_error = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1620 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1606 * 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" # <<<<<<<<<<<<<< @@ -56458,7 +55872,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1622 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1608 * reason_for_failure = "Inside edges of preceding subphrase are not tight" * else: * gap_start = 1 # <<<<<<<<<<<<<< @@ -56467,7 +55881,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_start = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1623 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1609 * else: * gap_start = 1 * if self.tight_phrases and f_links_low[f_low] == -1: # <<<<<<<<<<<<<< @@ -56482,7 +55896,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1626 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1612 * # 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 # <<<<<<<<<<<<<< @@ -56496,7 +55910,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L35:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1628 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1614 * met_constraints = 0 * * for i from 0 <= i < matching.size - 1: # <<<<<<<<<<<<<< @@ -56506,7 +55920,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_12 = (__pyx_v_matching->size - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1629 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1615 * * for i from 0 <= i < matching.size - 1: * f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start # <<<<<<<<<<<<<< @@ -56515,7 +55929,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1630 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1616 * 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 # <<<<<<<<<<<<<< @@ -56524,7 +55938,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1631 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1617 * 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 # <<<<<<<<<<<<<< @@ -56534,7 +55948,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_v_num_gaps = (__pyx_v_num_gaps + 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1633 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1619 * num_gaps = num_gaps + 1 * * if f_high < f_back_high: # <<<<<<<<<<<<<< @@ -56544,7 +55958,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_f_high < __pyx_v_f_back_high) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1634 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1620 * * if f_high < f_back_high: * f_gap_low[gap_start+num_gaps] = f_high # <<<<<<<<<<<<<< @@ -56553,7 +55967,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1635 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1621 * 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 # <<<<<<<<<<<<<< @@ -56562,7 +55976,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_back_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1636 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1622 * f_gap_low[gap_start+num_gaps] = f_high * f_gap_high[gap_start+num_gaps] = f_back_high * num_gaps = num_gaps + 1 # <<<<<<<<<<<<<< @@ -56571,7 +55985,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_num_gaps = (__pyx_v_num_gaps + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1637 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1623 * f_gap_high[gap_start+num_gaps] = f_back_high * num_gaps = num_gaps + 1 * phrase_len = phrase_len+1 # <<<<<<<<<<<<<< @@ -56580,7 +55994,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_phrase_len = (__pyx_v_phrase_len + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1638 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1624 * num_gaps = num_gaps + 1 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: # <<<<<<<<<<<<<< @@ -56590,7 +56004,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_phrase_len > __pyx_v_self->max_length) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1639 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1625 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: * gap_error = 1 # <<<<<<<<<<<<<< @@ -56602,7 +56016,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L43:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1640 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1626 * if phrase_len > self.max_length: * gap_error = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -56612,7 +56026,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = (__pyx_v_self->tight_phrases != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1641 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1627 * gap_error = 1 * if self.tight_phrases: * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: # <<<<<<<<<<<<<< @@ -56628,7 +56042,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1642 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1628 * if self.tight_phrases: * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: * gap_error = 1 # <<<<<<<<<<<<<< @@ -56637,7 +56051,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_error = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1643 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1629 * 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" # <<<<<<<<<<<<<< @@ -56656,7 +56070,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1645 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1631 * reason_for_failure = "Inside edges of following subphrase are not tight" * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: # <<<<<<<<<<<<<< @@ -56671,7 +56085,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1646 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1632 * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -56685,7 +56099,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L42:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1648 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1634 * met_constraints = 0 * * if gap_error == 0: # <<<<<<<<<<<<<< @@ -56695,7 +56109,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_gap_error == 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1649 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1635 * * if gap_error == 0: * e_word_count = e_high - e_low # <<<<<<<<<<<<<< @@ -56704,7 +56118,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_word_count = (__pyx_v_e_high - __pyx_v_e_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1650 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1636 * if gap_error == 0: * e_word_count = e_high - e_low * for i from 0 <= i < num_gaps: # check integrity of subphrases # <<<<<<<<<<<<<< @@ -56714,17 +56128,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_num_gaps; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1651 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1637 * 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 = 1651; __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 = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1656 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1642 * 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, # <<<<<<<<<<<<<< @@ -56735,7 +56149,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1658 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1644 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0) == 0: * gap_error = 1 # <<<<<<<<<<<<<< @@ -56744,18 +56158,18 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_error = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1659 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1645 * 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 = 1659; __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 = 1645; __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 = 1659; __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 = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1645; __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); @@ -56763,13 +56177,13 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_GIVEREF(__pyx_t_1); __pyx_t_10 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_138), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_138), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1660 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1646 * 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 # <<<<<<<<<<<<<< @@ -56786,7 +56200,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L47:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1662 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1648 * break * * if gap_error == 0: # <<<<<<<<<<<<<< @@ -56796,7 +56210,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_gap_error == 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1663 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1649 * * if gap_error == 0: * i = 1 # <<<<<<<<<<<<<< @@ -56805,21 +56219,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1664 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1650 * 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1650; __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 = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1650; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1665 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1651 * i = 1 * self.findexes.reset() * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -56829,7 +56243,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1666 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1652 * self.findexes.reset() * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56838,7 +56252,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1667 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1653 * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -56847,16 +56261,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1668 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1654 * 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_3 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_3); 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_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -56864,27 +56278,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L52:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1669 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1655 * 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __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[8]; __pyx_lineno = 1669; __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 = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->findexes1)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1)); - __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __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_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1670 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1656 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -56894,7 +56308,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1671 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1657 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -56904,7 +56318,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1672 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1658 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56913,7 +56327,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1673 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1659 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -56925,7 +56339,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1675 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1661 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -56937,7 +56351,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L55:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1676 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1662 * else: * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: # <<<<<<<<<<<<<< @@ -56947,7 +56361,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_f_back_high > __pyx_v_f_high) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1677 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1663 * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56956,16 +56370,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1678 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1664 * 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_10 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -56973,25 +56387,25 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L56:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1680 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1666 * 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_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __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 = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_fphr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr)); - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_v_fphr = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1681 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1667 * * fphr = Phrase(fphr_arr) * if met_constraints: # <<<<<<<<<<<<<< @@ -57001,37 +56415,37 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = (__pyx_v_met_constraints != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1684 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1670 * 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_10 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_v_phrase_list = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1685 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1671 * 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 = 1685; __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 = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = ((__pyx_t_13 > 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1686 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1672 * 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 = 1686; __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 = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); @@ -57040,14 +56454,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L58; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1688 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1674 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -57056,22 +56470,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_pair_count = 0.0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1689 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1675 * 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_10 = PyInt_FromLong(__pyx_v_f_back_low); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __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 = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyInt_FromLong(__pyx_v_e_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __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 = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = PyInt_FromLong(__pyx_v_e_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __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 = 1675; __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 = 1689; __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 = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -57085,7 +56499,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_14 = 0; - __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_139), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_139), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __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_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_t_14)); @@ -57093,7 +56507,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L58:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1690 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1676 * 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: # <<<<<<<<<<<<<< @@ -57104,7 +56518,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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 = 1690; __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 = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; } @@ -57112,23 +56526,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1676; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1676; __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 = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -57144,7 +56558,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -57157,16 +56571,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext; @@ -57174,7 +56588,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L61_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __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; @@ -57182,7 +56596,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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 = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L62_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_1); @@ -57190,7 +56604,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1691 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1677 * 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) # <<<<<<<<<<<<<< @@ -57199,31 +56613,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_t_15 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_15); - if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF_SET(__pyx_v_als1, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1692 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1678 * 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 * phrase_len < self.max_length and */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1692; __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 = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)__pyx_v_als1)); PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_als1)); __Pyx_GIVEREF(((PyObject *)__pyx_v_als1)); - __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 = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1678; __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 = 1692; __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 = 1678; __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)); @@ -57237,7 +56651,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_GIVEREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_1 = 0; - __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 = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1678; __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_1); __pyx_t_1 = 0; @@ -57247,7 +56661,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L57:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1693 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1679 * 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 # <<<<<<<<<<<<<< @@ -57257,7 +56671,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_num_gaps < __pyx_v_self->max_nonterminals) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1694 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1680 * extracts.append((fphr, phrase2, pair_count, tuple(als1))) * if (num_gaps < self.max_nonterminals and * phrase_len < self.max_length and # <<<<<<<<<<<<<< @@ -57267,7 +56681,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_7 = ((__pyx_v_phrase_len < __pyx_v_self->max_length) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1695 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1681 * 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): # <<<<<<<<<<<<<< @@ -57285,7 +56699,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1696 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1682 * 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 # <<<<<<<<<<<<<< @@ -57295,7 +56709,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_7 = ((__pyx_v_f_back_low == __pyx_v_f_low) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1697 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1683 * 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 # <<<<<<<<<<<<<< @@ -57305,7 +56719,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_f_low >= __pyx_v_self->train_min_gap_size) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1698 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1684 * 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))): # <<<<<<<<<<<<<< @@ -57335,7 +56749,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1699 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1685 * 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 # <<<<<<<<<<<<<< @@ -57344,7 +56758,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1700 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1686 * ((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 # <<<<<<<<<<<<<< @@ -57353,7 +56767,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1701 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1687 * f_x_low = f_low-self.train_min_gap_size * met_constraints = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -57363,7 +56777,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = (__pyx_v_self->tight_phrases != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1702 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1688 * met_constraints = 1 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<< @@ -57380,7 +56794,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (!__pyx_t_18) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1703 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1689 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 # <<<<<<<<<<<<<< @@ -57393,7 +56807,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L65:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1704 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1690 * 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: # <<<<<<<<<<<<<< @@ -57409,7 +56823,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1705 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1691 * 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 # <<<<<<<<<<<<<< @@ -57421,7 +56835,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L68:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1707 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1693 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -57430,17 +56844,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ if ((__pyx_v_met_constraints != 0)) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1708 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1694 * * 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 = 1708; __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 = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1712 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1698 * 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, # <<<<<<<<<<<<<< @@ -57451,7 +56865,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1714 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1700 * self.train_max_initial_size, self.train_max_initial_size, * 1, 1, 1, 1, 0, 1, 0) == 1) and * ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and # <<<<<<<<<<<<<< @@ -57467,17 +56881,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1715 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1701 * 1, 1, 1, 1, 0, 1, 0) == 1) 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_14 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1719 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1705 * -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, # <<<<<<<<<<<<<< @@ -57499,7 +56913,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1721 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1707 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -57508,7 +56922,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1722 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1708 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -57517,35 +56931,35 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1723 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1709 * 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); 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_t_1 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1709; __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_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1724 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1710 * 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_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1710; __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 = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1710; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1725 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1711 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57554,7 +56968,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1726 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1712 * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -57563,27 +56977,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1727 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1713 * 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1713; __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 = 1727; __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 = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((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_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __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 = 1713; __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_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1728 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1714 * i = i+1 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -57593,7 +57007,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1729 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1715 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -57603,7 +57017,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_7 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1730 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1716 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57612,7 +57026,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1731 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1717 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -57624,7 +57038,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1733 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1719 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -57636,7 +57050,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L72:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1734 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1720 * else: * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: # <<<<<<<<<<<<<< @@ -57646,7 +57060,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_7 = ((__pyx_v_f_back_high > __pyx_v_f_high) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1735 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1721 * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57655,16 +57069,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1736 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1722 * 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_15 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1722; __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 = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1722; __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; @@ -57672,55 +57086,55 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L73:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1737 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1723 * 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_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __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 = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((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_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_15)); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1740 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1726 * 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_15 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1741 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1727 * 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 = 1741; __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 = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((__pyx_t_13 > 0) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1742 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1728 * 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 = 1742; __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 = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); @@ -57729,14 +57143,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L74; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1744 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1730 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -57747,7 +57161,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L74:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1745 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1731 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -57758,7 +57172,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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_15 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext; } @@ -57766,23 +57180,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1731; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __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 = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -57798,7 +57212,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -57811,16 +57225,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __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 = 1731; __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; @@ -57828,7 +57242,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_GOTREF(__pyx_t_14); index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L77_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __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; @@ -57836,7 +57250,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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 = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L78_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_14); @@ -57844,7 +57258,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1746 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1732 * pair_count = 0 * for phrase2, eindexes in phrase_list: * als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -57853,31 +57267,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_t_1 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_1); - if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_als2, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1747 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1733 * 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_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1747; __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 = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_als2)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_als2)); __Pyx_GIVEREF(((PyObject *)__pyx_v_als2)); - __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 = 1747; __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 = 1733; __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 = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_fphr)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_fphr)); @@ -57891,7 +57305,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_GIVEREF(__pyx_t_14); __pyx_t_3 = 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 = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1733; __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; @@ -57904,7 +57318,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L64:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1749 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1735 * extracts.append((fphr, phrase2, pair_count, tuple(als2))) * * if (f_back_high == f_high and # <<<<<<<<<<<<<< @@ -57914,7 +57328,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_7 = ((__pyx_v_f_back_high == __pyx_v_f_high) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1750 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1736 * * if (f_back_high == f_high and * f_sent_len - f_high >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -57924,7 +57338,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_8 = (((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size) != 0); if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1751 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1737 * 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))): # <<<<<<<<<<<<<< @@ -57954,7 +57368,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1752 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1738 * 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 # <<<<<<<<<<<<<< @@ -57963,7 +57377,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1753 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1739 * ((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 # <<<<<<<<<<<<<< @@ -57972,7 +57386,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1754 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1740 * f_x_high = f_high+self.train_min_gap_size * met_constraints = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -57982,7 +57396,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_8 = (__pyx_v_self->tight_phrases != 0); if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1755 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1741 * met_constraints = 1 * if self.tight_phrases: * while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<< @@ -57999,7 +57413,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (!__pyx_t_18) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1756 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1742 * 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 # <<<<<<<<<<<<<< @@ -58012,7 +57426,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L80:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1757 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1743 * 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: # <<<<<<<<<<<<<< @@ -58028,7 +57442,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1758 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1744 * 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 # <<<<<<<<<<<<<< @@ -58040,7 +57454,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L83:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1760 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1746 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -58049,17 +57463,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ if ((__pyx_v_met_constraints != 0)) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1761 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1747 * * 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_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1765 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1751 * 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, # <<<<<<<<<<<<<< @@ -58069,7 +57483,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct if ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0)) { __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1767 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1753 * 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 # <<<<<<<<<<<<<< @@ -58085,17 +57499,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1768 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1754 * 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_14 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1773 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1759 * 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, # <<<<<<<<<<<<<< @@ -58118,7 +57532,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1775 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1761 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -58127,7 +57541,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1776 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1762 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -58136,21 +57550,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1777 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1763 * fphr_arr._clear() * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); 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); - __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 = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1763; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1778 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1764 * i = 1 * self.findexes.reset() * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -58160,7 +57574,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_7 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1779 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1765 * self.findexes.reset() * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -58169,7 +57583,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1780 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1766 * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -58178,16 +57592,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1781 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1767 * 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_14 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __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 = 1781; __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 = 1767; __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; @@ -58195,27 +57609,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L85:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1782 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1768 * 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_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); 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_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyTuple_New(1); 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_INCREF(((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_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1768; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1783 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1769 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -58225,7 +57639,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1784 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1770 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -58235,7 +57649,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_7 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1785 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1771 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -58244,7 +57658,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1786 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1772 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -58256,7 +57670,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1788 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1774 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -58268,7 +57682,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L88:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1789 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1775 * else: * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -58277,69 +57691,69 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1790 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1776 * 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_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1776; __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 = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1776; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1791 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1777 * 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_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyTuple_New(1); 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_INCREF(((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_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; __Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1794 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1780 * 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_1 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1795 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1781 * 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 = 1795; __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 = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((__pyx_t_13 > 0) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1796 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1782 * 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 = 1796; __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 = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); @@ -58348,14 +57762,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L89; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1798 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1784 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -58366,7 +57780,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L89:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1799 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1785 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -58377,7 +57791,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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_1 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -58385,23 +57799,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1785; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -58417,7 +57831,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -58430,16 +57844,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __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 = 1785; __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; @@ -58447,7 +57861,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_GOTREF(__pyx_t_15); index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L92_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L93_unpacking_done; @@ -58455,7 +57869,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L93_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_15); @@ -58463,7 +57877,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1800 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1786 * pair_count = 0 * for phrase2, eindexes in phrase_list: * als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -58472,31 +57886,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_t_14 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_14); - if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_14), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_14), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF_SET(__pyx_v_als3, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1801 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1787 * 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_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __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 = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(((PyObject *)__pyx_v_als3)); PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_als3)); __Pyx_GIVEREF(((PyObject *)__pyx_v_als3)); - __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 = 1801; __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 = 1787; __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 = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(((PyObject *)__pyx_v_fphr)); PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_fphr)); @@ -58510,7 +57924,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_GIVEREF(__pyx_t_15); __pyx_t_3 = 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 = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1787; __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; @@ -58523,7 +57937,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L79:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1802 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1788 * 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 # <<<<<<<<<<<<<< @@ -58533,7 +57947,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_7 = ((__pyx_v_num_gaps < (__pyx_v_self->max_nonterminals - 1)) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1803 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1789 * extracts.append((fphr, phrase2, pair_count, tuple(als3))) * if (num_gaps < self.max_nonterminals - 1 and * phrase_len+1 < self.max_length and # <<<<<<<<<<<<<< @@ -58543,7 +57957,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_8 = (((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length) != 0); if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1804 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1790 * if (num_gaps < self.max_nonterminals - 1 and * phrase_len+1 < self.max_length and * f_back_high == f_high and # <<<<<<<<<<<<<< @@ -58553,7 +57967,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_18 = ((__pyx_v_f_back_high == __pyx_v_f_high) != 0); if (__pyx_t_18) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1805 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1791 * phrase_len+1 < self.max_length and * f_back_high == f_high and * f_back_low == f_low and # <<<<<<<<<<<<<< @@ -58563,7 +57977,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_9 = ((__pyx_v_f_back_low == __pyx_v_f_low) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1806 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1792 * 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 # <<<<<<<<<<<<<< @@ -58573,7 +57987,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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) != 0); if (__pyx_t_19) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1807 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1793 * 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 # <<<<<<<<<<<<<< @@ -58583,7 +57997,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_20 = ((__pyx_v_f_low >= __pyx_v_self->train_min_gap_size) != 0); if (__pyx_t_20) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1808 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1794 * 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 # <<<<<<<<<<<<<< @@ -58593,7 +58007,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_21 = ((__pyx_v_f_high <= (__pyx_v_f_sent_len - __pyx_v_self->train_min_gap_size)) != 0); if (__pyx_t_21) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1809 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1795 * 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))): # <<<<<<<<<<<<<< @@ -58643,7 +58057,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1811 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1797 * ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))): * * met_constraints = 1 # <<<<<<<<<<<<<< @@ -58652,7 +58066,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1812 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1798 * * met_constraints = 1 * f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<< @@ -58661,7 +58075,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1813 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1799 * met_constraints = 1 * f_x_low = f_low-self.train_min_gap_size * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -58671,7 +58085,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_8 = (__pyx_v_self->tight_phrases != 0); if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1814 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1800 * 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: # <<<<<<<<<<<<<< @@ -58688,7 +58102,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (!__pyx_t_18) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1815 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1801 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 # <<<<<<<<<<<<<< @@ -58701,7 +58115,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L95:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1816 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1802 * 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: # <<<<<<<<<<<<<< @@ -58711,7 +58125,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_18 = ((__pyx_v_f_x_low < 0) != 0); if (__pyx_t_18) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1817 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1803 * f_x_low = f_x_low - 1 * if f_x_low < 0: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -58723,7 +58137,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L98:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1819 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1805 * met_constraints = 0 * * f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<< @@ -58732,7 +58146,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1820 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1806 * * f_x_high = f_high+self.train_min_gap_size * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -58742,7 +58156,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_18 = (__pyx_v_self->tight_phrases != 0); if (__pyx_t_18) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1821 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1807 * 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: # <<<<<<<<<<<<<< @@ -58759,7 +58173,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1822 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1808 * 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 # <<<<<<<<<<<<<< @@ -58772,7 +58186,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L99:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1823 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1809 * 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: # <<<<<<<<<<<<<< @@ -58788,7 +58202,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1824 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1810 * 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 # <<<<<<<<<<<<<< @@ -58800,7 +58214,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L102:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1826 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1812 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -58809,17 +58223,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ if ((__pyx_v_met_constraints != 0)) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1827 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1813 * * 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_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1831 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1817 * 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, # <<<<<<<<<<<<<< @@ -58830,7 +58244,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1833 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1819 * self.train_max_initial_size, self.train_max_initial_size, * 1, 1, 2, 1, 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 # <<<<<<<<<<<<<< @@ -58852,17 +58266,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_18) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1834 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1820 * 1, 1, 2, 1, 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_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1838 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1824 * -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, # <<<<<<<<<<<<<< @@ -58873,17 +58287,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1840 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1826 * 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_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1845 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1831 * 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, # <<<<<<<<<<<<<< @@ -58910,7 +58324,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1847 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1833 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -58919,7 +58333,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1848 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1834 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -58928,35 +58342,35 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1849 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1835 * 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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1835; __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 = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1850 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1836 * 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_15 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1836; __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 = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1836; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1851 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1837 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -58965,7 +58379,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1852 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1838 * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -58974,27 +58388,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1853 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1839 * 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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1839; __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 = 1853; __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 = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((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_14 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1839; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1854 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1840 * i = i+1 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -59004,7 +58418,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1855 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1841 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -59014,7 +58428,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_8 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1856 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1842 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -59023,7 +58437,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1857 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1843 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -59035,7 +58449,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1859 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1845 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -59047,7 +58461,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L106:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1860 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1846 * else: * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -59056,69 +58470,69 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1861 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1847 * 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __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 = 1861; __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 = 1847; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1862 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1848 * 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 = 1862; __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 = 1848; __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_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_14)); __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1865 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1851 * 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_4cdec_2sa_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 = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_14); __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1866 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1852 * 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 = 1866; __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 = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((__pyx_t_13 > 0) != 0); if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1867 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1853 * 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 = 1867; __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 = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); @@ -59127,14 +58541,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L107; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1869 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1855 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -59145,7 +58559,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L107:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1870 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1856 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -59156,7 +58570,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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 = 1870; __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 = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; } @@ -59164,23 +58578,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1856; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1856; __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 = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -59196,7 +58610,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -59209,16 +58623,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext; @@ -59226,7 +58640,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L110_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __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; @@ -59234,7 +58648,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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 = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L111_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_1); @@ -59242,7 +58656,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1871 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1857 * pair_count = 0 * for phrase2, eindexes in phrase_list: * als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -59251,31 +58665,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_t_15 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_15); - if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF_SET(__pyx_v_als4, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1872 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1858 * 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_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1872; __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 = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)__pyx_v_als4)); PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_als4)); __Pyx_GIVEREF(((PyObject *)__pyx_v_als4)); - __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 = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1858; __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 = 1872; __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 = 1858; __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)); @@ -59289,7 +58703,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_GIVEREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_1 = 0; - __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 = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1858; __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_1); __pyx_t_1 = 0; @@ -59311,7 +58725,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1874 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1860 * extracts.append((fphr, phrase2, pair_count, tuple(als4))) * else: * reason_for_failure = "Unable to extract basic phrase" # <<<<<<<<<<<<<< @@ -59326,7 +58740,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L33:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1876 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1862 * reason_for_failure = "Unable to extract basic phrase" * * free(sent_links) # <<<<<<<<<<<<<< @@ -59335,7 +58749,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_sent_links); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1877 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1863 * * free(sent_links) * free(f_links_low) # <<<<<<<<<<<<<< @@ -59344,7 +58758,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_f_links_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1878 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1864 * free(sent_links) * free(f_links_low) * free(f_links_high) # <<<<<<<<<<<<<< @@ -59353,7 +58767,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_f_links_high); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1879 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1865 * free(f_links_low) * free(f_links_high) * free(e_links_low) # <<<<<<<<<<<<<< @@ -59362,7 +58776,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_e_links_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1880 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1866 * free(f_links_high) * free(e_links_low) * free(e_links_high) # <<<<<<<<<<<<<< @@ -59371,7 +58785,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_e_links_high); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1881 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1867 * free(e_links_low) * free(e_links_high) * free(f_gap_low) # <<<<<<<<<<<<<< @@ -59380,7 +58794,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_f_gap_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1882 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1868 * free(e_links_high) * free(f_gap_low) * free(f_gap_high) # <<<<<<<<<<<<<< @@ -59389,7 +58803,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_f_gap_high); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1883 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1869 * free(f_gap_low) * free(f_gap_high) * free(e_gap_low) # <<<<<<<<<<<<<< @@ -59398,7 +58812,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_e_gap_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1884 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1870 * free(f_gap_high) * free(e_gap_low) * free(e_gap_high) # <<<<<<<<<<<<<< @@ -59407,7 +58821,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_e_gap_high); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1886 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1872 * free(e_gap_high) * * return extracts # <<<<<<<<<<<<<< @@ -59466,7 +58880,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f_words,&__pyx_n_s__e_words,&__pyx_n_s__alignment,&__pyx_n_s__ctx_name,0}; PyObject* values[4] = {0,0,0,0}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1894 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1880 * # Aggregate stats from a training instance * # (Extract rules, update counts) * def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<< @@ -59493,12 +58907,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_words)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -59507,7 +58921,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_instance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_instance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -59526,7 +58940,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.add_instance", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -59583,46 +58997,46 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_bound)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__links)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt_open)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -59649,7 +59063,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.add_instance.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -59660,7 +59074,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1928 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914 * # f_ i and j are current, e_ i and j are previous * # We care _considering_ f_j, so it is not yet in counts * def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<< @@ -59705,33 +59119,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1930 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1916 * def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<< * return * # Unaligned word */ - if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __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 = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) { - __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_t_5; } else { @@ -59739,7 +59153,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1931 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1917 * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: * return # <<<<<<<<<<<<<< @@ -59753,41 +59167,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1933 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1919 * return * # Unaligned word * if not al[f_j]: # <<<<<<<<<<<<<< * # Adjacent to non-terminal: extend (non-terminal now open) * if nt and nt[-1][2] == f_j - 1: */ - if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = ((!__pyx_t_6) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1935 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1921 * if not al[f_j]: * # Adjacent to non-terminal: extend (non-terminal now open) * if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<< * nt[-1][2] += 1 * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; } else { @@ -59795,80 +59209,80 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1936 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1922 * # Adjacent to non-terminal: extend (non-terminal now open) * if nt and nt[-1][2] == f_j - 1: * nt[-1][2] += 1 # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) * nt[-1][2] -= 1 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = 2; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetItemInt(__pyx_t_1, __pyx_t_7, __pyx_t_2, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_1, __pyx_t_7, __pyx_t_2, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1937 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1923 * if nt and nt[-1][2] == f_j - 1: * nt[-1][2] += 1 * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) # <<<<<<<<<<<<<< * nt[-1][2] -= 1 * # Unless non-terminal already open, always extend with word */ - __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1938 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1924 * nt[-1][2] += 1 * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) * nt[-1][2] -= 1 # <<<<<<<<<<<<<< * # Unless non-terminal already open, always extend with word * # Make sure adding a word doesn't exceed length */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = 2; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetItemInt(__pyx_t_4, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_4, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5; } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1941 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1927 * # Unless non-terminal already open, always extend with word * # Make sure adding a word doesn't exceed length * if not nt_open and wc < self.max_length: # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False) * return */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (!__pyx_t_5); if (__pyx_t_3) { - __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_5; } else { @@ -59876,21 +59290,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1942 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1928 * # Make sure adding a word doesn't exceed length * if not nt_open and wc < self.max_length: * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<< * return * # Aligned word */ - __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_t_4, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_t_4, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -59900,7 +59314,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1943 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1929 * if not nt_open and wc < self.max_length: * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False) * return # <<<<<<<<<<<<<< @@ -59914,27 +59328,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1945 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1931 * return * # Aligned word * link_i = fe_span[f_j][0] # <<<<<<<<<<<<<< * link_j = fe_span[f_j][1] * new_e_i = min(link_i, e_i) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_fe_span)) { __Pyx_RaiseClosureNameError("fe_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_fe_span)) { __Pyx_RaiseClosureNameError("fe_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_link_i = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1946 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1932 * # Aligned word * link_i = fe_span[f_j][0] * link_j = fe_span[f_j][1] # <<<<<<<<<<<<<< @@ -59943,17 +59357,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc */ if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_link_j = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1947 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1933 * link_i = fe_span[f_j][0] * link_j = fe_span[f_j][1] * new_e_i = min(link_i, e_i) # <<<<<<<<<<<<<< @@ -59964,8 +59378,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __pyx_t_8 = __pyx_v_e_i; __Pyx_INCREF(__pyx_v_link_i); __pyx_t_2 = __pyx_v_link_i; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_8); @@ -59982,7 +59396,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __pyx_v_new_e_i = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1948 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1934 * link_j = fe_span[f_j][1] * new_e_i = min(link_i, e_i) * new_e_j = max(link_j, e_j) # <<<<<<<<<<<<<< @@ -59993,8 +59407,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __pyx_t_8 = __pyx_v_e_j; __Pyx_INCREF(__pyx_v_link_j); __pyx_t_4 = __pyx_v_link_j; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_8); @@ -60011,7 +59425,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __pyx_v_new_e_j = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1951 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1937 * # Check reverse links of newly covered words to see if they violate left * # bound (return) or extend minimum right bound for chunk * new_min_bound = min_bound # <<<<<<<<<<<<<< @@ -60021,57 +59435,57 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_INCREF(__pyx_v_min_bound); __pyx_v_new_min_bound = __pyx_v_min_bound; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1953 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1939 * new_min_bound = min_bound * # First aligned word creates span * if e_j == -1: # <<<<<<<<<<<<<< * for i from new_e_i <= i <= new_e_j: * if ef_span[i][0] < f_i: */ - __pyx_t_8 = PyObject_RichCompare(__pyx_v_e_j, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_v_e_j, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1954 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1940 * # First aligned word creates span * if e_j == -1: * for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_11 = __pyx_t_9; __pyx_t_11 <= __pyx_t_10; __pyx_t_11++) { - __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1955 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1941 * if e_j == -1: * for i from new_e_i <= i <= new_e_j: * if ef_span[i][0] < f_i: # <<<<<<<<<<<<<< * return * new_min_bound = max(new_min_bound, ef_span[i][1]) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1956 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1942 * for i from new_e_i <= i <= new_e_j: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -60085,7 +59499,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L10:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1957 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1943 * if ef_span[i][0] < f_i: * return * new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<< @@ -60094,17 +59508,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc */ if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_INCREF(__pyx_v_new_min_bound); __pyx_t_8 = __pyx_v_new_min_bound; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_2); @@ -60120,17 +59534,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_new_min_bound, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1954 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1940 * # First aligned word creates span * if e_j == -1: * for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_2 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; @@ -60138,45 +59552,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1960 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1946 * # Other aligned words extend span * else: * for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_e_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_e_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_9 = __pyx_t_11; __pyx_t_9 < __pyx_t_10; __pyx_t_9++) { - __pyx_t_2 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1961 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1947 * else: * for i from new_e_i <= i < e_i: * if ef_span[i][0] < f_i: # <<<<<<<<<<<<<< * return * new_min_bound = max(new_min_bound, ef_span[i][1]) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1962 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1948 * for i from new_e_i <= i < e_i: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -60190,7 +59604,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L13:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1963 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1949 * if ef_span[i][0] < f_i: * return * new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<< @@ -60199,17 +59613,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc */ if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v_new_min_bound); __pyx_t_2 = __pyx_v_new_min_bound; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_4); @@ -60225,60 +59639,60 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_new_min_bound, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1960 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1946 * # Other aligned words extend span * else: * for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_4 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1964 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1950 * return * new_min_bound = max(new_min_bound, ef_span[i][1]) * for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_e_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_e_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_11 = __pyx_t_9+1; __pyx_t_11 <= __pyx_t_10; __pyx_t_11++) { - __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1965 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1951 * new_min_bound = max(new_min_bound, ef_span[i][1]) * for i from e_j < i <= new_e_j: * if ef_span[i][0] < f_i: # <<<<<<<<<<<<<< * return * new_min_bound = max(new_min_bound, ef_span[i][1]) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1966 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1952 * for i from e_j < i <= new_e_j: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -60292,7 +59706,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L16:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1967 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1953 * if ef_span[i][0] < f_i: * return * new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<< @@ -60301,17 +59715,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc */ if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_v_new_min_bound); __pyx_t_4 = __pyx_v_new_min_bound; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_8); @@ -60327,35 +59741,35 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_new_min_bound, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1964 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1950 * return * new_min_bound = max(new_min_bound, ef_span[i][1]) * for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8); __pyx_t_8 = 0; } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1969 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1955 * new_min_bound = max(new_min_bound, ef_span[i][1]) * # Extract, extend with word (unless non-terminal open) * if not nt_open: # <<<<<<<<<<<<<< * nt_collision = False * for link in al[f_j]: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((!__pyx_t_6) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1970 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1956 * # Extract, extend with word (unless non-terminal open) * if not nt_open: * nt_collision = False # <<<<<<<<<<<<<< @@ -60364,20 +59778,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc */ __pyx_v_nt_collision = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1971 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1957 * if not nt_open: * nt_collision = False * for link in al[f_j]: # <<<<<<<<<<<<<< * if e_nt_cover[link]: * nt_collision = True */ - __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -60386,23 +59800,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_8 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -60411,25 +59825,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1972 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1958 * nt_collision = False * for link in al[f_j]: * if e_nt_cover[link]: # <<<<<<<<<<<<<< * nt_collision = True * # Non-terminal collisions block word extraction and extension, but */ - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover), __pyx_v_link); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover), __pyx_v_link); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1973 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1959 * for link in al[f_j]: * if e_nt_cover[link]: * nt_collision = True # <<<<<<<<<<<<<< @@ -60443,7 +59857,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1976 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1962 * # Non-terminal collisions block word extraction and extension, but * # may be okay for continuing non-terminals * if not nt_collision and wc < self.max_length: # <<<<<<<<<<<<<< @@ -60452,11 +59866,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc */ __pyx_t_3 = (!(__pyx_v_nt_collision != 0)); if (__pyx_t_3) { - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_5 = __pyx_t_6; } else { @@ -60464,32 +59878,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1977 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1963 * # may be okay for continuing non-terminals * if not nt_collision and wc < self.max_length: * plus_links = [] # <<<<<<<<<<<<<< * for link in al[f_j]: * plus_links.append((f_j, link)) */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_v_plus_links = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1978 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1964 * if not nt_collision and wc < self.max_length: * plus_links = [] * for link in al[f_j]: # <<<<<<<<<<<<<< * plus_links.append((f_j, link)) * cover[link] += 1 */ - __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -60498,23 +59912,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_8 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -60523,14 +59937,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1979 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1965 * plus_links = [] * for link in al[f_j]: * plus_links.append((f_j, link)) # <<<<<<<<<<<<<< * cover[link] += 1 * links.append(plus_links) */ - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_f_j); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_j); @@ -60538,20 +59952,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_INCREF(__pyx_v_link); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link); __Pyx_GIVEREF(__pyx_v_link); - __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_plus_links, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_plus_links, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1980 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1966 * for link in al[f_j]: * plus_links.append((f_j, link)) * cover[link] += 1 # <<<<<<<<<<<<<< * links.append(plus_links) * if links and f_j >= new_min_bound: */ - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_cover) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); __pyx_t_14 = __pyx_cur_scope->__pyx_v_cover; @@ -60559,46 +59973,46 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __pyx_t_8 = __pyx_v_link; if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_t_14), __pyx_t_8); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_t_14), __pyx_t_8); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (PyObject_SetItem(((PyObject *)__pyx_t_14), __pyx_t_8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(((PyObject *)__pyx_t_14), __pyx_t_8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1981 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1967 * plus_links.append((f_j, link)) * cover[link] += 1 * links.append(plus_links) # <<<<<<<<<<<<<< * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) */ - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_links, ((PyObject *)__pyx_v_plus_links)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_links, ((PyObject *)__pyx_v_plus_links)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1982 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1968 * cover[link] += 1 * links.append(plus_links) * if links and f_j >= new_min_bound: # <<<<<<<<<<<<<< * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __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 = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __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 = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_3; } else { @@ -60606,33 +60020,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1983 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1969 * links.append(plus_links) * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * links.pop() */ - if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_rules) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_i); @@ -60652,62 +60066,62 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_GIVEREF(__pyx_v_links); __pyx_t_1 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __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_8)); __pyx_t_8 = 0; - __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L24; } __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1984 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1970 * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<< * links.pop() * for link in al[f_j]: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1985 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1971 * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * links.pop() # <<<<<<<<<<<<<< * for link in al[f_j]: * cover[link] -= 1 */ - __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1986 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1972 * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * links.pop() * for link in al[f_j]: # <<<<<<<<<<<<<< * cover[link] -= 1 * # Try to add a word to current non-terminal (if any), extract, extend */ - __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -60716,23 +60130,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_1 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -60741,17 +60155,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1987 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1973 * links.pop() * for link in al[f_j]: * cover[link] -= 1 # <<<<<<<<<<<<<< * # Try to add a word to current non-terminal (if any), extract, extend * if nt and nt[-1][2] == f_j - 1: */ - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_cover) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); __pyx_t_14 = __pyx_cur_scope->__pyx_v_cover; @@ -60759,18 +60173,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __pyx_t_1 = __pyx_v_link; if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_t_14), __pyx_t_1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_t_14), __pyx_t_1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (PyObject_SetItem(((PyObject *)__pyx_t_14), __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(((PyObject *)__pyx_t_14), __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; @@ -60783,26 +60197,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L17:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1989 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1975 * cover[link] -= 1 * # Try to add a word to current non-terminal (if any), extract, extend * if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<< * # Add to non-terminal, checking for collisions * old_last_nt = nt[-1][:] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; } else { @@ -60810,70 +60224,70 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1991 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1977 * if nt and nt[-1][2] == f_j - 1: * # Add to non-terminal, checking for collisions * old_last_nt = nt[-1][:] # <<<<<<<<<<<<<< * nt[-1][2] = f_j * if link_i < nt[-1][3]: */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, NULL, &__pyx_k_slice_141, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, NULL, &__pyx_k_slice_141, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_old_last_nt = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1992 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1978 * # Add to non-terminal, checking for collisions * old_last_nt = nt[-1][:] * nt[-1][2] = f_j # <<<<<<<<<<<<<< * if link_i < nt[-1][3]: * if not span_check(cover, link_i, nt[-1][3] - 1): */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemInt(__pyx_t_2, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_2, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1993 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1979 * old_last_nt = nt[-1][:] * nt[-1][2] = f_j * if link_i < nt[-1][3]: # <<<<<<<<<<<<<< * if not span_check(cover, link_i, nt[-1][3] - 1): * nt[-1] = old_last_nt */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __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 = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1994 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1980 * nt[-1][2] = f_j * if link_i < nt[-1][3]: * if not span_check(cover, link_i, nt[-1][3] - 1): # <<<<<<<<<<<<<< * nt[-1] = old_last_nt * return */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); @@ -60884,25 +60298,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __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_1)); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = ((!__pyx_t_3) != 0); if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1995 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1981 * if link_i < nt[-1][3]: * if not span_check(cover, link_i, nt[-1][3] - 1): * nt[-1] = old_last_nt # <<<<<<<<<<<<<< * return * span_inc(cover, link_i, nt[-1][3] - 1) */ - if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1996 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1982 * if not span_check(cover, link_i, nt[-1][3] - 1): * nt[-1] = old_last_nt * return # <<<<<<<<<<<<<< @@ -60916,24 +60330,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L29:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1997 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1983 * nt[-1] = old_last_nt * return * span_inc(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< * span_inc(e_nt_cover, link_i, nt[-1][3] - 1) * nt[-1][3] = link_i */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); @@ -60944,31 +60358,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __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_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1998 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1984 * return * span_inc(cover, link_i, nt[-1][3] - 1) * span_inc(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< * nt[-1][3] = link_i * if link_j > nt[-1][4]: */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); @@ -60979,64 +60393,64 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __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_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1999 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1985 * span_inc(cover, link_i, nt[-1][3] - 1) * span_inc(e_nt_cover, link_i, nt[-1][3] - 1) * nt[-1][3] = link_i # <<<<<<<<<<<<<< * if link_j > nt[-1][4]: * if not span_check(cover, nt[-1][4] + 1, link_j): */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemInt(__pyx_t_2, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_2, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L28; } __pyx_L28:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2000 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1986 * span_inc(e_nt_cover, link_i, nt[-1][3] - 1) * nt[-1][3] = link_i * if link_j > nt[-1][4]: # <<<<<<<<<<<<<< * if not span_check(cover, nt[-1][4] + 1, link_j): * nt[-1] = old_last_nt */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2001 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1987 * nt[-1][3] = link_i * if link_j > nt[-1][4]: * if not span_check(cover, nt[-1][4] + 1, link_j): # <<<<<<<<<<<<<< * nt[-1] = old_last_nt * return */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); @@ -61047,25 +60461,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __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_1)); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = ((!__pyx_t_6) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2002 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1988 * if link_j > nt[-1][4]: * if not span_check(cover, nt[-1][4] + 1, link_j): * nt[-1] = old_last_nt # <<<<<<<<<<<<<< * return * span_inc(cover, nt[-1][4] + 1, link_j) */ - if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2003 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1989 * if not span_check(cover, nt[-1][4] + 1, link_j): * nt[-1] = old_last_nt * return # <<<<<<<<<<<<<< @@ -61079,24 +60493,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L31:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2004 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1990 * nt[-1] = old_last_nt * return * span_inc(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<< * span_inc(e_nt_cover, nt[-1][4] + 1, link_j) * nt[-1][4] = link_j */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); @@ -61107,31 +60521,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __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_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2005 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1991 * return * span_inc(cover, nt[-1][4] + 1, link_j) * span_inc(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<< * nt[-1][4] = link_j * if links and f_j >= new_min_bound: */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); @@ -61142,38 +60556,38 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __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_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2006 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1992 * span_inc(cover, nt[-1][4] + 1, link_j) * span_inc(e_nt_cover, nt[-1][4] + 1, link_j) * nt[-1][4] = link_j # <<<<<<<<<<<<<< * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemInt(__pyx_t_2, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_2, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L30; } __pyx_L30:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2007 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1993 * span_inc(e_nt_cover, nt[-1][4] + 1, link_j) * nt[-1][4] = link_j * if links and f_j >= new_min_bound: # <<<<<<<<<<<<<< * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __pyx_t_6; } else { @@ -61181,33 +60595,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2008 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1994 * nt[-1][4] = link_j * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) * nt[-1] = old_last_nt */ - if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_rules) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_i); @@ -61227,80 +60641,80 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_GIVEREF(__pyx_v_links); __pyx_t_1 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_8); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_8); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L32; } __pyx_L32:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2009 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1995 * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) # <<<<<<<<<<<<<< * nt[-1] = old_last_nt * if link_i < nt[-1][3]: */ - __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_8, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_8, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2010 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1996 * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) * nt[-1] = old_last_nt # <<<<<<<<<<<<<< * if link_i < nt[-1][3]: * span_dec(cover, link_i, nt[-1][3] - 1) */ - if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2011 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1997 * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) * nt[-1] = old_last_nt * if link_i < nt[-1][3]: # <<<<<<<<<<<<<< * span_dec(cover, link_i, nt[-1][3] - 1) * span_dec(e_nt_cover, link_i, nt[-1][3] - 1) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2012 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1998 * nt[-1] = old_last_nt * if link_i < nt[-1][3]: * span_dec(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< * span_dec(e_nt_cover, link_i, nt[-1][3] - 1) * if link_j > nt[-1][4]: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); @@ -61311,31 +60725,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __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_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2013 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1999 * if link_i < nt[-1][3]: * span_dec(cover, link_i, nt[-1][3] - 1) * span_dec(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< * if link_j > nt[-1][4]: * span_dec(cover, nt[-1][4] + 1, link_j) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); @@ -61346,7 +60760,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; @@ -61355,43 +60769,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L33:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2014 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2000 * span_dec(cover, link_i, nt[-1][3] - 1) * span_dec(e_nt_cover, link_i, nt[-1][3] - 1) * if link_j > nt[-1][4]: # <<<<<<<<<<<<<< * span_dec(cover, nt[-1][4] + 1, link_j) * span_dec(e_nt_cover, nt[-1][4] + 1, link_j) */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2015 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2001 * span_dec(e_nt_cover, link_i, nt[-1][3] - 1) * if link_j > nt[-1][4]: * span_dec(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<< * span_dec(e_nt_cover, nt[-1][4] + 1, link_j) * # Try to start a new non-terminal, extract, extend */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); @@ -61402,31 +60816,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2016 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2002 * if link_j > nt[-1][4]: * span_dec(cover, nt[-1][4] + 1, link_j) * span_dec(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<< * # Try to start a new non-terminal, extract, extend * if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); @@ -61437,7 +60851,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __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_8)); __pyx_t_8 = 0; @@ -61449,41 +60863,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L27:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2018 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2004 * span_dec(e_nt_cover, nt[-1][4] + 1, link_j) * # Try to start a new non-terminal, extract, extend * if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals: # <<<<<<<<<<<<<< * # Check for collisions * if not span_check(cover, link_i, link_j): */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (!__pyx_t_5); if (!__pyx_t_3) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_6 = __pyx_t_5; } else { __pyx_t_6 = __pyx_t_3; } if (__pyx_t_6) { - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - __pyx_t_7 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = (__pyx_t_7 < __pyx_cur_scope->__pyx_v_self->max_nonterminals); __pyx_t_15 = __pyx_t_5; } else { @@ -61495,17 +60909,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2020 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2006 * if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals: * # Check for collisions * if not span_check(cover, link_i, link_j): # <<<<<<<<<<<<<< * return * span_inc(cover, link_i, link_j) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); @@ -61516,16 +60930,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __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 = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = ((!__pyx_t_3) != 0); if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2021 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2007 * # Check for collisions * if not span_check(cover, link_i, link_j): * return # <<<<<<<<<<<<<< @@ -61539,16 +60953,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L36:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2022 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2008 * if not span_check(cover, link_i, link_j): * return * span_inc(cover, link_i, link_j) # <<<<<<<<<<<<<< * span_inc(e_nt_cover, link_i, link_j) * nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); @@ -61559,23 +60973,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __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_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2023 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2009 * return * span_inc(cover, link_i, link_j) * span_inc(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<< * nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) * # Require at least one word in phrase */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); @@ -61586,27 +61000,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2024 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2010 * span_inc(cover, link_i, link_j) * span_inc(e_nt_cover, link_i, link_j) * nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) # <<<<<<<<<<<<<< * # Require at least one word in phrase * if links and f_j >= new_min_bound: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_8; @@ -61615,7 +61029,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_INCREF(__pyx_int_1); __pyx_t_2 = __pyx_int_1; } - __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -61632,22 +61046,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyList_SET_ITEM(__pyx_t_8, 4, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2026 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2012 * nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) * # Require at least one word in phrase * if links and f_j >= new_min_bound: # <<<<<<<<<<<<<< * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __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 = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __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 = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_15 = __pyx_t_3; } else { @@ -61655,33 +61069,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_15) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2027 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2013 * # Require at least one word in phrase * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * nt.pop() */ - if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_rules) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_i); @@ -61701,58 +61115,58 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_GIVEREF(__pyx_v_links); __pyx_t_4 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __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_8)); __pyx_t_8 = 0; - __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L37; } __pyx_L37:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2028 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2014 * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<< * nt.pop() * span_dec(cover, link_i, link_j) */ - __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2029 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2015 * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * nt.pop() # <<<<<<<<<<<<<< * span_dec(cover, link_i, link_j) * span_dec(e_nt_cover, link_i, link_j) */ - __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2030 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2016 * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * nt.pop() * span_dec(cover, link_i, link_j) # <<<<<<<<<<<<<< * span_dec(e_nt_cover, link_i, link_j) * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); @@ -61763,22 +61177,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2031 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2017 * nt.pop() * span_dec(cover, link_i, link_j) * span_dec(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<< * * # Try to extract phrases from every f index */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); @@ -61789,7 +61203,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; @@ -61823,7 +61237,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1894 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1880 * # Aggregate stats from a training instance * # (Extract rules, update counts) * def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<< @@ -61837,23 +61251,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_e = NULL; CYTHON_UNUSED PyObject *__pyx_v_f_nt_cover = NULL; - PyObject *__pyx_v_f_i = NULL; + long __pyx_v_f_i; PyObject *__pyx_v_stats = NULL; CYTHON_UNUSED PyObject *__pyx_v_lex_i = NULL; CYTHON_UNUSED PyObject *__pyx_v_lex_j = NULL; PyObject *__pyx_v_rule = NULL; PyObject *__pyx_v_f_ph = NULL; PyObject *__pyx_v_e_ph = NULL; - PyObject *__pyx_v_aligned_fe = NULL; - PyObject *__pyx_v_aligned_ef = NULL; - int __pyx_v_null_word; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_j = NULL; - PyObject *__pyx_v_e_i_aligned = NULL; - PyObject *__pyx_v_lc = NULL; - PyObject *__pyx_v_e_i = NULL; - PyObject *__pyx_v_f_i_aligned = NULL; - CYTHON_UNUSED PyObject *__pyx_v__ = NULL; + CYTHON_UNUSED PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -61866,13 +61271,10 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; long __pyx_t_10; - long __pyx_t_11; - int __pyx_t_12; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; - Py_ssize_t __pyx_t_14; - PyObject *(*__pyx_t_15)(PyObject *); - PyObject *__pyx_t_16 = NULL; - int __pyx_t_17; + PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -61893,7 +61295,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_words); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1896 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1882 * def add_instance(self, f_words, e_words, alignment, ctx_name=None): * * self.online = True # <<<<<<<<<<<<<< @@ -61902,20 +61304,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc */ __pyx_cur_scope->__pyx_v_self->online = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1903 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1889 * # span more than once. * # (f, e, al, lex_f_i, lex_f_j) * rules = set() # <<<<<<<<<<<<<< * * f_len = len(f_words) */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_cur_scope->__pyx_v_rules = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1905 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1891 * rules = set() * * f_len = len(f_words) # <<<<<<<<<<<<<< @@ -61924,15 +61326,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_f_words; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __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[8]; __pyx_lineno = 1891; __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[8]; __pyx_lineno = 1905; __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[8]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_f_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1906 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1892 * * f_len = len(f_words) * e_len = len(e_words) # <<<<<<<<<<<<<< @@ -61941,35 +61343,35 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __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[8]; __pyx_lineno = 1892; __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[8]; __pyx_lineno = 1906; __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[8]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_e_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1909 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1895 * * # Pre-compute alignment info * al = [[] for i in range(f_len)] # <<<<<<<<<<<<<< * fe_span = [[e_len + 1, -1] for i in range(f_len)] * ef_span = [[f_len + 1, -1] for i in range(e_len)] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __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 = 1895; __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[8]; __pyx_lineno = 1909; __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 = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_len); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f_len); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_len); - __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -61978,23 +61380,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -62002,9 +61404,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -62012,28 +61414,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_cur_scope->__pyx_v_al = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1910 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1896 * # Pre-compute alignment info * al = [[] for i in range(f_len)] * fe_span = [[e_len + 1, -1] for i in range(f_len)] # <<<<<<<<<<<<<< * ef_span = [[f_len + 1, -1] for i in range(e_len)] * for f, e in alignment: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __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 = 1896; __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[8]; __pyx_lineno = 1910; __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 = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_len); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f_len); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_len); - __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -62042,23 +61444,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -62066,9 +61468,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_v_e_len, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_e_len, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -62076,7 +61478,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); __pyx_t_4 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -62084,28 +61486,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_cur_scope->__pyx_v_fe_span = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1911 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1897 * al = [[] for i in range(f_len)] * fe_span = [[e_len + 1, -1] for i in range(f_len)] * ef_span = [[f_len + 1, -1] for i in range(e_len)] # <<<<<<<<<<<<<< * for f, e in alignment: * al[f].append(e) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __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 = 1897; __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[8]; __pyx_lineno = 1911; __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 = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_e_len); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_e_len); __Pyx_GIVEREF(__pyx_v_e_len); - __pyx_t_6 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) { __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -62114,23 +61516,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_6 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_6)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -62138,9 +61540,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); @@ -62148,7 +61550,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -62156,7 +61558,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_cur_scope->__pyx_v_ef_span = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1912 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1898 * fe_span = [[e_len + 1, -1] for i in range(f_len)] * ef_span = [[f_len + 1, -1] for i in range(e_len)] * for f, e in alignment: # <<<<<<<<<<<<<< @@ -62167,7 +61569,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_t_1 = __pyx_v_alignment; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -62175,23 +61577,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1898; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -62207,7 +61609,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -62220,16 +61622,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __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; @@ -62237,7 +61639,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_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 = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L12_unpacking_done; @@ -62245,7 +61647,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L12_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4); @@ -62253,21 +61655,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1913 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1899 * ef_span = [[f_len + 1, -1] for i in range(e_len)] * for f, e in alignment: * al[f].append(e) # <<<<<<<<<<<<<< * fe_span[f][0] = min(fe_span[f][0], e) * fe_span[f][1] = max(fe_span[f][1], e) */ - __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1900 * for f, e in alignment: * al[f].append(e) * fe_span[f][0] = min(fe_span[f][0], e) # <<<<<<<<<<<<<< @@ -62276,13 +61678,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc */ __Pyx_INCREF(__pyx_v_e); __pyx_t_6 = __pyx_v_e; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_t_6); @@ -62296,13 +61698,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemInt(__pyx_t_3, 0, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_3, 0, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1915 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1901 * al[f].append(e) * fe_span[f][0] = min(fe_span[f][0], e) * fe_span[f][1] = max(fe_span[f][1], e) # <<<<<<<<<<<<<< @@ -62311,13 +61713,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc */ __Pyx_INCREF(__pyx_v_e); __pyx_t_6 = __pyx_v_e; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_t_6); @@ -62331,13 +61733,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1916 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1902 * fe_span[f][0] = min(fe_span[f][0], e) * fe_span[f][1] = max(fe_span[f][1], e) * ef_span[e][0] = min(ef_span[e][0], f) # <<<<<<<<<<<<<< @@ -62346,13 +61748,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc */ __Pyx_INCREF(__pyx_v_f); __pyx_t_6 = __pyx_v_f; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_t_6); @@ -62366,13 +61768,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemInt(__pyx_t_3, 0, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_3, 0, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1917 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1903 * fe_span[f][1] = max(fe_span[f][1], e) * ef_span[e][0] = min(ef_span[e][0], f) * ef_span[e][1] = max(ef_span[e][1], f) # <<<<<<<<<<<<<< @@ -62381,13 +61783,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc */ __Pyx_INCREF(__pyx_v_f); __pyx_t_6 = __pyx_v_f; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_t_6); @@ -62401,27 +61803,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1920 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1906 * * # Target side word coverage * cover = [0] * e_len # <<<<<<<<<<<<<< * # Non-terminal coverage * f_nt_cover = [0] * f_len */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_temp; @@ -62430,19 +61832,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_cur_scope->__pyx_v_cover = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1922 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1908 * cover = [0] * e_len * # Non-terminal coverage * f_nt_cover = [0] * f_len # <<<<<<<<<<<<<< * e_nt_cover = [0] * e_len * */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_f_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_f_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_temp; @@ -62450,19 +61852,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_v_f_nt_cover = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1923 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1909 * # Non-terminal coverage * f_nt_cover = [0] * f_len * e_nt_cover = [0] * e_len # <<<<<<<<<<<<<< * * # Extract all possible hierarchical phrases starting at a source index */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_temp; @@ -62471,48 +61873,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_cur_scope->__pyx_v_e_nt_cover = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1928 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914 * # f_ i and j are current, e_ i and j are previous * # We care _considering_ f_j, so it is not yet in counts * def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<< * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, __pyx_n_s_145, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_143)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, __pyx_n_s_145, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_143)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2034 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2020 * * # Try to extract phrases from every f index * for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<< * # Skip if phrases won't be tight on left side * if not al[f_i]: */ - __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11++) { - __pyx_t_1 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_10; __pyx_v_f_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2036 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2022 * for f_i from 0 <= f_i < f_len: * # Skip if phrases won't be tight on left side * if not al[f_i]: # <<<<<<<<<<<<<< * continue * extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) */ - __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_i, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = ((!__pyx_t_9) != 0); - if (__pyx_t_12) { + __pyx_t_11 = ((!__pyx_t_9) != 0); + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2037 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2023 * # Skip if phrases won't be tight on left side * if not al[f_i]: * continue # <<<<<<<<<<<<<< @@ -62524,111 +61922,107 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc } __pyx_L15:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2038 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2024 * if not al[f_i]: * continue * extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) # <<<<<<<<<<<<<< * * stats = self.online_stats[ctx_name] */ - __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_v_f_i, __pyx_t_1, __pyx_int_neg_1, __pyx_v_f_i, __pyx_int_0, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_3), __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_6, __pyx_t_3, __pyx_int_neg_1, __pyx_t_4, __pyx_int_0, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_12), __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __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_6)); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_L13_continue:; - __pyx_t_11 = __Pyx_PyInt_AsLong(__pyx_v_f_i); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2034 - * - * # Try to extract phrases from every f index - * for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<< - * # Skip if phrases won't be tight on left side - * if not al[f_i]: - */ - __pyx_t_7 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_7); - __pyx_t_7 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2040 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2026 * extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) * * stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<< * * # Update possible phrases (samples) */ - __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_v_stats = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_v_stats = __pyx_t_14; + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2045 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2031 * # This could be more efficiently integrated with extraction * # at the cost of readability * for f, lex_i, lex_j in self.get_f_phrases(f_words): # <<<<<<<<<<<<<< * stats.samples_f[f] += 1 * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_f_words); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_f_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words); - __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0; + __pyx_t_12 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; + if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) { + __pyx_t_13 = __pyx_t_12; __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + __pyx_t_2 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = Py_TYPE(__pyx_t_13)->tp_iternext; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; for (;;) { - if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_4)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_13)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_13)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_4)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_13)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_13)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { + __pyx_t_12 = __pyx_t_5(__pyx_t_13); + if (unlikely(!__pyx_t_12)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_12); } - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; + 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 @@ -62637,120 +62031,120 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { - __pyx_t_7 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - __pyx_t_1 = PyList_GET_ITEM(sequence, 2); + __pyx_t_14 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { Py_ssize_t index = -1; - __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = Py_TYPE(__pyx_t_13)->tp_iternext; - index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L18_unpacking_failed; + __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; + index = 0; __pyx_t_14 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_14)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_14); + index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - index = 2; __pyx_t_1 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_13), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + index = 2; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L19_unpacking_done; __pyx_L18_unpacking_failed:; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L19_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_14); + __pyx_t_14 = 0; + __Pyx_XDECREF_SET(__pyx_v_lex_i, __pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF_SET(__pyx_v_lex_i, __pyx_t_6); - __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_v_lex_j, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_lex_j, __pyx_t_4); + __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2046 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2032 * # at the cost of readability * for f, lex_i, lex_j in self.get_f_phrases(f_words): * stats.samples_f[f] += 1 # <<<<<<<<<<<<<< * * # Update phrase counts */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_f); - __pyx_t_1 = __pyx_v_f; - __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_t_1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_v_f; + __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_t_1, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2049 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2035 * * # Update phrase counts * for rule in rules: # <<<<<<<<<<<<<< * (f_ph, e_ph, al) = rule[:3] * stats.phrases_f[f_ph] += 1 */ - __pyx_t_4 = PyObject_GetIter(((PyObject *)__pyx_cur_scope->__pyx_v_rules)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + __pyx_t_13 = PyObject_GetIter(((PyObject *)__pyx_cur_scope->__pyx_v_rules)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = Py_TYPE(__pyx_t_13)->tp_iternext; for (;;) { { - __pyx_t_3 = __pyx_t_5(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { + __pyx_t_12 = __pyx_t_5(__pyx_t_13); + if (unlikely(!__pyx_t_12)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_12); } - __Pyx_XDECREF_SET(__pyx_v_rule, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_rule, __pyx_t_12); + __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2050 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2036 * # Update phrase counts * for rule in rules: * (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<< * stats.phrases_f[f_ph] += 1 * stats.phrases_e[e_ph] += 1 */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_rule, 0, 3, NULL, NULL, &__pyx_k_slice_146, 0, 1, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; + __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_rule, 0, 3, NULL, NULL, &__pyx_k_slice_146, 0, 1, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + 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 @@ -62759,898 +62153,168 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); - __pyx_t_6 = PyList_GET_ITEM(sequence, 2); + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_14 = PyList_GET_ITEM(sequence, 1); + __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { Py_ssize_t index = -1; - __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = Py_TYPE(__pyx_t_13)->tp_iternext; - index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L22_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L22_unpacking_failed; + __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; + index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L22_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_14 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_14)) goto __pyx_L22_unpacking_failed; + __Pyx_GOTREF(__pyx_t_14); + index = 2; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L22_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L22_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_13), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L23_unpacking_done; __pyx_L22_unpacking_failed:; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L23_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_f_ph, __pyx_t_1); - __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_e_ph, __pyx_t_7); - __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_f_ph, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_e_ph, __pyx_t_14); + __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_al); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_al, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_al, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2051 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2037 * for rule in rules: * (f_ph, e_ph, al) = rule[:3] * stats.phrases_f[f_ph] += 1 # <<<<<<<<<<<<<< * stats.phrases_e[e_ph] += 1 * stats.phrases_fe[f_ph][e_ph] += 1 */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_f_ph); - __pyx_t_6 = __pyx_v_f_ph; - __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __pyx_v_f_ph; + __pyx_t_14 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_t_6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2052 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2038 * (f_ph, e_ph, al) = rule[:3] * stats.phrases_f[f_ph] += 1 * stats.phrases_e[e_ph] += 1 # <<<<<<<<<<<<<< * stats.phrases_fe[f_ph][e_ph] += 1 * if not stats.phrases_al[f_ph][e_ph]: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_e); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_e); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_e_ph); - __pyx_t_6 = __pyx_v_e_ph; - __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_t_6, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_v_e_ph; + __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2053 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2039 * stats.phrases_f[f_ph] += 1 * stats.phrases_e[e_ph] += 1 * stats.phrases_fe[f_ph][e_ph] += 1 # <<<<<<<<<<<<<< * if not stats.phrases_al[f_ph][e_ph]: * stats.phrases_al[f_ph][e_ph] = al */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_f_ph); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_v_e_ph); - __pyx_t_3 = __pyx_v_e_ph; - __pyx_t_7 = PyObject_GetItem(__pyx_t_6, __pyx_t_3); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_f_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_INCREF(__pyx_v_e_ph); + __pyx_t_12 = __pyx_v_e_ph; + __pyx_t_14 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_t_3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2054 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2040 * stats.phrases_e[e_ph] += 1 * stats.phrases_fe[f_ph][e_ph] += 1 * if not stats.phrases_al[f_ph][e_ph]: # <<<<<<<<<<<<<< * stats.phrases_al[f_ph][e_ph] = al * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_GetItem(__pyx_t_6, __pyx_v_f_ph); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_e_ph); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = ((!__pyx_t_12) != 0); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = PyObject_GetItem(__pyx_t_7, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_e_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = ((!__pyx_t_11) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2055 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2041 * stats.phrases_fe[f_ph][e_ph] += 1 * if not stats.phrases_al[f_ph][e_ph]: * stats.phrases_al[f_ph][e_ph] = al # <<<<<<<<<<<<<< * - * # Update Bilexical counts - */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_GetItem(__pyx_t_6, __pyx_v_f_ph); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L24; - } - __pyx_L24:; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2058 - * - * # Update Bilexical counts - * aligned_fe = [list() for _ in range(len(f_words))] # <<<<<<<<<<<<<< - * aligned_ef = [list() for _ in range(len(e_words))] - * null_word = sym_fromstring('NULL', True) - */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_cur_scope->__pyx_v_f_words; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_2 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_6)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_6)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_6)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_6)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_6); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_aligned_fe = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2059 - * # Update Bilexical counts - * aligned_fe = [list() for _ in range(len(f_words))] - * aligned_ef = [list() for _ in range(len(e_words))] # <<<<<<<<<<<<<< - * null_word = sym_fromstring('NULL', True) - * for (i, j) in alignment: - */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __pyx_cur_scope->__pyx_v_e_words; - __Pyx_INCREF(__pyx_t_6); - __pyx_t_2 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) { - __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - for (;;) { - if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_6 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_6)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_6); - } - __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_aligned_ef = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2060 - * aligned_fe = [list() for _ in range(len(f_words))] - * aligned_ef = [list() for _ in range(len(e_words))] - * null_word = sym_fromstring('NULL', True) # <<<<<<<<<<<<<< - * for (i, j) in alignment: - * aligned_fe[i].append(j) - */ - __pyx_v_null_word = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_k__NULL, 1); - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2061 - * aligned_ef = [list() for _ in range(len(e_words))] - * null_word = sym_fromstring('NULL', True) - * for (i, j) in alignment: # <<<<<<<<<<<<<< - * aligned_fe[i].append(j) - * aligned_ef[j].append(i) - */ - if (PyList_CheckExact(__pyx_v_alignment) || PyTuple_CheckExact(__pyx_v_alignment)) { - __pyx_t_4 = __pyx_v_alignment; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; - } - for (;;) { - if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_4)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_4)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __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 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 = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_6 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_1); - #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - { - Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __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_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L31_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L31_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L32_unpacking_done; - __pyx_L31_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L32_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); - __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1); - __pyx_t_1 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2062 - * null_word = sym_fromstring('NULL', True) - * for (i, j) in alignment: - * aligned_fe[i].append(j) # <<<<<<<<<<<<<< - * aligned_ef[j].append(i) - * for f_i in range(len(f_words)): - */ - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_fe), __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __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; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2063 - * for (i, j) in alignment: - * aligned_fe[i].append(j) - * aligned_ef[j].append(i) # <<<<<<<<<<<<<< - * for f_i in range(len(f_words)): - * stats.bilex_f[f_words[f_i]] += 1 - */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_ef), __pyx_v_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __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; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2064 - * aligned_fe[i].append(j) - * aligned_ef[j].append(i) - * for f_i in range(len(f_words)): # <<<<<<<<<<<<<< - * stats.bilex_f[f_words[f_i]] += 1 - * e_i_aligned = aligned_fe[f_i] - */ - __pyx_t_4 = __pyx_cur_scope->__pyx_v_f_words; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __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[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_4 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_4); - __pyx_t_4 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2065 - * aligned_ef[j].append(i) - * for f_i in range(len(f_words)): - * stats.bilex_f[f_words[f_i]] += 1 # <<<<<<<<<<<<<< - * e_i_aligned = aligned_fe[f_i] - * lc = len(e_i_aligned) - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_t_1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetItem(__pyx_t_4, __pyx_t_1, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2066 - * for f_i in range(len(f_words)): - * stats.bilex_f[f_words[f_i]] += 1 - * e_i_aligned = aligned_fe[f_i] # <<<<<<<<<<<<<< - * lc = len(e_i_aligned) - * if lc > 0: - */ - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_fe), __pyx_v_f_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_e_i_aligned, __pyx_t_4); - __pyx_t_4 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2067 - * stats.bilex_f[f_words[f_i]] += 1 - * e_i_aligned = aligned_fe[f_i] - * lc = len(e_i_aligned) # <<<<<<<<<<<<<< - * if lc > 0: - * for e_i in e_i_aligned: - */ - __pyx_t_14 = PyObject_Length(__pyx_v_e_i_aligned); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_lc, __pyx_t_4); - __pyx_t_4 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2068 - * e_i_aligned = aligned_fe[f_i] - * lc = len(e_i_aligned) - * if lc > 0: # <<<<<<<<<<<<<< - * for e_i in e_i_aligned: - * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc - */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_lc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_9) { - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2069 - * lc = len(e_i_aligned) - * if lc > 0: - * for e_i in e_i_aligned: # <<<<<<<<<<<<<< - * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc - * else: - */ - if (PyList_CheckExact(__pyx_v_e_i_aligned) || PyTuple_CheckExact(__pyx_v_e_i_aligned)) { - __pyx_t_4 = __pyx_v_e_i_aligned; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0; - __pyx_t_15 = NULL; - } else { - __pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_e_i_aligned); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext; - } - for (;;) { - if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_4)) { - if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_4)) { - if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_1 = __pyx_t_15(__pyx_t_4); - if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_e_i, __pyx_t_1); - __pyx_t_1 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2070 - * if lc > 0: - * for e_i in e_i_aligned: - * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc # <<<<<<<<<<<<<< - * else: - * stats.bilex_fe[f_words[f_i]][null_word] += 1 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_t_7); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_GetItem(__pyx_t_6, __pyx_t_7); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_t_13, __pyx_v_lc); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_16); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_t_7, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L35; - } - /*else*/ { - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2072 - * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc - * else: - * stats.bilex_fe[f_words[f_i]][null_word] += 1 # <<<<<<<<<<<<<< - * for e_i in range(len(e_words)): - * stats.bilex_e[e_words[e_i]] += 1 + * # Create a rule from source, target, non-terminals, and alignments */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_t_6); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_17 = __pyx_v_null_word; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, __pyx_t_17, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetItemInt(__pyx_t_7, __pyx_t_17, __pyx_t_4, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = PyObject_GetItem(__pyx_t_7, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyObject_SetItem(__pyx_t_12, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L24; } - __pyx_L35:; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2073 - * else: - * stats.bilex_fe[f_words[f_i]][null_word] += 1 - * for e_i in range(len(e_words)): # <<<<<<<<<<<<<< - * stats.bilex_e[e_words[e_i]] += 1 - * f_i_aligned = aligned_ef[e_i] - */ - __pyx_t_3 = __pyx_cur_scope->__pyx_v_e_words; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __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[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = Py_TYPE(__pyx_t_7)->tp_iternext; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_7)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_7)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_7); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_e_i, __pyx_t_3); - __pyx_t_3 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2074 - * stats.bilex_fe[f_words[f_i]][null_word] += 1 - * for e_i in range(len(e_words)): - * stats.bilex_e[e_words[e_i]] += 1 # <<<<<<<<<<<<<< - * f_i_aligned = aligned_ef[e_i] - * lc = len(f_i_aligned) - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_e); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2075 - * for e_i in range(len(e_words)): - * stats.bilex_e[e_words[e_i]] += 1 - * f_i_aligned = aligned_ef[e_i] # <<<<<<<<<<<<<< - * lc = len(f_i_aligned) - * if lc > 0: - */ - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_ef), __pyx_v_e_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_f_i_aligned, __pyx_t_3); - __pyx_t_3 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2076 - * stats.bilex_e[e_words[e_i]] += 1 - * f_i_aligned = aligned_ef[e_i] - * lc = len(f_i_aligned) # <<<<<<<<<<<<<< - * if lc > 0: - * for f_i in f_i_aligned: - */ - __pyx_t_14 = PyObject_Length(__pyx_v_f_i_aligned); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_lc, __pyx_t_3); - __pyx_t_3 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2077 - * f_i_aligned = aligned_ef[e_i] - * lc = len(f_i_aligned) - * if lc > 0: # <<<<<<<<<<<<<< - * for f_i in f_i_aligned: - * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc - */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_lc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_9) { - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2078 - * lc = len(f_i_aligned) - * if lc > 0: - * for f_i in f_i_aligned: # <<<<<<<<<<<<<< - * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc - * else: - */ - if (PyList_CheckExact(__pyx_v_f_i_aligned) || PyTuple_CheckExact(__pyx_v_f_i_aligned)) { - __pyx_t_3 = __pyx_v_f_i_aligned; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0; - __pyx_t_15 = NULL; - } else { - __pyx_t_14 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_f_i_aligned); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = Py_TYPE(__pyx_t_3)->tp_iternext; - } - for (;;) { - if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_3)) { - if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_3)) { - if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_4 = __pyx_t_15(__pyx_t_3); - if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_4); - __pyx_t_4 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2079 - * if lc > 0: - * for f_i in f_i_aligned: - * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc # <<<<<<<<<<<<<< - * else: - * stats.bilex_ef[e_words[e_i]][null_word] += 1 - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_ef); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_t_13); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_4 = PyObject_GetItem(__pyx_t_6, __pyx_t_13); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_16 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_16, __pyx_v_lc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_t_13, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L40; - } - /*else*/ { - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2081 - * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc - * else: - * stats.bilex_ef[e_words[e_i]][null_word] += 1 # <<<<<<<<<<<<<< - * - * # Create a rule from source, target, non-terminals, and alignments - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_ef); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_17 = __pyx_v_null_word; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_13, __pyx_t_17, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetItemInt(__pyx_t_13, __pyx_t_17, __pyx_t_3, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __pyx_L40:; + __pyx_L24:; } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -63660,8 +62324,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); - __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.add_instance", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -63669,22 +62334,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_f_nt_cover); - __Pyx_XDECREF(__pyx_v_f_i); __Pyx_XDECREF(__pyx_v_stats); __Pyx_XDECREF(__pyx_v_lex_i); __Pyx_XDECREF(__pyx_v_lex_j); __Pyx_XDECREF(__pyx_v_rule); __Pyx_XDECREF(__pyx_v_f_ph); __Pyx_XDECREF(__pyx_v_e_ph); - __Pyx_XDECREF(__pyx_v_aligned_fe); - __Pyx_XDECREF(__pyx_v_aligned_ef); __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_j); - __Pyx_XDECREF(__pyx_v_e_i_aligned); - __Pyx_XDECREF(__pyx_v_lc); - __Pyx_XDECREF(__pyx_v_e_i); - __Pyx_XDECREF(__pyx_v_f_i_aligned); - __Pyx_XDECREF(__pyx_v__); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -63730,31 +62386,31 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_span)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_span)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__al)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "form_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "form_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -63775,7 +62431,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -63787,9 +62443,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P } /* Python wrapper */ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8 = {__Pyx_NAMESTR("lambda8"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6 = {__Pyx_NAMESTR("lambda6"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; int __pyx_lineno = 0; @@ -63797,7 +62453,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda8 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0}; PyObject* values[2] = {0,0}; @@ -63818,11 +62474,11 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda8") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda6") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -63835,18 +62491,18 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda8(__pyx_self, __pyx_v_x, __pyx_v_y); + __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, __pyx_v_x, __pyx_v_y); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2087 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2047 * * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<< @@ -63854,7 +62510,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la * off = f_i */ -static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { +static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -63863,13 +62519,13 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda8", 0); + __Pyx_RefNannySetupContext("lambda6", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __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[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __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); @@ -63877,7 +62533,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -63890,7 +62546,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -63899,9 +62555,9 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self } /* Python wrapper */ -static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9 = {__Pyx_NAMESTR("lambda9"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7 = {__Pyx_NAMESTR("lambda7"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; int __pyx_lineno = 0; @@ -63909,7 +62565,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda9 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0}; PyObject* values[2] = {0,0}; @@ -63930,11 +62586,11 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda9") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda7") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -63947,18 +62603,18 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda9(__pyx_self, __pyx_v_x, __pyx_v_y); + __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, __pyx_v_x, __pyx_v_y); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2111 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2071 * # Adjusting alignment links takes some doing * links = [list(link) for sub in al for link in sub] * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<< @@ -63966,7 +62622,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l * nt_len = len(nt) */ -static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { +static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -63975,13 +62631,13 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda9", 0); + __Pyx_RefNannySetupContext("lambda7", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __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[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __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); @@ -63989,7 +62645,7 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -64002,7 +62658,7 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -64011,7 +62667,7 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self } static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<< @@ -64037,7 +62693,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2g __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -64081,19 +62737,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __Pyx_RaiseClosureNameError("links"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __Pyx_RaiseClosureNameError("links"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; @@ -64105,7 +62761,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -64118,16 +62774,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; @@ -64135,7 +62791,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; @@ -64143,7 +62799,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); @@ -64154,10 +62810,10 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_j, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment->__pyx_vtab)->link(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment, __pyx_t_8, __pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment->__pyx_vtab)->link(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment, __pyx_t_8, __pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -64174,7 +62830,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetNone(PyExc_StopIteration); @@ -64194,7 +62850,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2084 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2044 * * # Create a rule from source, target, non-terminals, and alignments * def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<< @@ -64251,52 +62907,52 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2087 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2047 * * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<< * f_sym = list(f_span[:]) * off = f_i */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __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 = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_nt); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nt); __Pyx_GIVEREF(__pyx_v_nt); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_nt_inv = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2088 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2048 * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) # <<<<<<<<<<<<<< * off = f_i * for next_nt in nt: */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_f_span, 0, 0, NULL, NULL, &__pyx_k_slice_148, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_f_span, 0, 0, NULL, NULL, &__pyx_k_slice_148, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __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 = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); 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*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_f_sym = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2089 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2049 * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) * off = f_i # <<<<<<<<<<<<<< @@ -64306,7 +62962,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_f_i); __pyx_v_off = __pyx_v_f_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2090 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2050 * f_sym = list(f_span[:]) * off = f_i * for next_nt in nt: # <<<<<<<<<<<<<< @@ -64317,7 +62973,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_t_3 = __pyx_v_nt; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -64325,23 +62981,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64350,28 +63006,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2091 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2051 * off = f_i * for next_nt in nt: * nt_len = (next_nt[2] - next_nt[1]) + 1 # <<<<<<<<<<<<<< * i = 0 * while i < nt_len: */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2092 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2052 * for next_nt in nt: * nt_len = (next_nt[2] - next_nt[1]) + 1 * i = 0 # <<<<<<<<<<<<<< @@ -64381,7 +63037,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2093 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2053 * nt_len = (next_nt[2] - next_nt[1]) + 1 * i = 0 * while i < nt_len: # <<<<<<<<<<<<<< @@ -64389,82 +63045,82 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * i += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2094 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2054 * i = 0 * while i < nt_len: * f_sym.pop(next_nt[1] - off) # <<<<<<<<<<<<<< * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __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_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2095 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2055 * while i < nt_len: * f_sym.pop(next_nt[1] - off) * i += 1 # <<<<<<<<<<<<<< * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2096 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2056 * f_sym.pop(next_nt[1] - off) * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<< * off += (nt_len - 1) * e_sym = list(e_span[:]) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2097 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2057 * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) # <<<<<<<<<<<<<< * e_sym = list(e_span[:]) * off = e_i */ - __pyx_t_6 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2); @@ -64472,27 +63128,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2098 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2058 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) * e_sym = list(e_span[:]) # <<<<<<<<<<<<<< * off = e_i * for next_nt in nt_inv: */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_e_span, 0, 0, NULL, NULL, &__pyx_k_slice_149, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_e_span, 0, 0, NULL, NULL, &__pyx_k_slice_149, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __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 = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); 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*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_e_sym = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2099 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2059 * off += (nt_len - 1) * e_sym = list(e_span[:]) * off = e_i # <<<<<<<<<<<<<< @@ -64502,7 +63158,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_e_i); __Pyx_DECREF_SET(__pyx_v_off, __pyx_v_e_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2100 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2060 * e_sym = list(e_span[:]) * off = e_i * for next_nt in nt_inv: # <<<<<<<<<<<<<< @@ -64513,7 +63169,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_t_3 = __pyx_v_nt_inv; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt_inv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt_inv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -64521,23 +63177,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64546,28 +63202,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2101 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2061 * off = e_i * for next_nt in nt_inv: * nt_len = (next_nt[4] - next_nt[3]) + 1 # <<<<<<<<<<<<<< * i = 0 * while i < nt_len: */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __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_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2102 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2062 * for next_nt in nt_inv: * nt_len = (next_nt[4] - next_nt[3]) + 1 * i = 0 # <<<<<<<<<<<<<< @@ -64577,7 +63233,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2103 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2063 * nt_len = (next_nt[4] - next_nt[3]) + 1 * i = 0 * while i < nt_len: # <<<<<<<<<<<<<< @@ -64585,82 +63241,82 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * i += 1 */ while (1) { - __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2104 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2064 * i = 0 * while i < nt_len: * e_sym.pop(next_nt[3] - off) # <<<<<<<<<<<<<< * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __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 = 2064; __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_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2065 * while i < nt_len: * e_sym.pop(next_nt[3] - off) * i += 1 # <<<<<<<<<<<<<< * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2106 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2066 * e_sym.pop(next_nt[3] - off) * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<< * off += (nt_len - 1) * */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2107 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2067 * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) # <<<<<<<<<<<<<< * * # Adjusting alignment links takes some doing */ - __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2); @@ -64668,20 +63324,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2070 * * # Adjusting alignment links takes some doing * links = [list(link) for sub in al for link in sub] # <<<<<<<<<<<<<< * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) * links_len = len(links) */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __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 = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyList_CheckExact(__pyx_v_al) || PyTuple_CheckExact(__pyx_v_al)) { __pyx_t_2 = __pyx_v_al; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_al); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_al); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -64689,23 +63345,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64717,7 +63373,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_t_1 = __pyx_v_sub; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -64725,23 +63381,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_6 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_6)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64749,15 +63405,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_link); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_link); __Pyx_GIVEREF(__pyx_v_link); - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -64767,32 +63423,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_cur_scope->__pyx_v_links = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2111 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2071 * # Adjusting alignment links takes some doing * links = [list(link) for sub in al for link in sub] * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<< * links_len = len(links) * nt_len = len(nt) */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __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 = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_links)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_links)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_links)); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_links_inv = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2112 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2072 * links = [list(link) for sub in al for link in sub] * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) * links_len = len(links) # <<<<<<<<<<<<<< @@ -64803,29 +63459,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_links_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2113 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2073 * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) * links_len = len(links) * nt_len = len(nt) # <<<<<<<<<<<<<< * nt_i = 0 * off = f_i */ - __pyx_t_4 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2114 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2074 * links_len = len(links) * nt_len = len(nt) * nt_i = 0 # <<<<<<<<<<<<<< @@ -64835,7 +63491,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __pyx_v_nt_i = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2115 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2075 * nt_len = len(nt) * nt_i = 0 * off = f_i # <<<<<<<<<<<<<< @@ -64845,7 +63501,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_f_i); __Pyx_DECREF_SET(__pyx_v_off, __pyx_v_f_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2116 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2076 * nt_i = 0 * off = f_i * i = 0 # <<<<<<<<<<<<<< @@ -64855,7 +63511,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2117 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2077 * off = f_i * i = 0 * while i < links_len: # <<<<<<<<<<<<<< @@ -64863,12 +63519,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * off += (nt[nt_i][2] - nt[nt_i][1]) */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2118 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2078 * i = 0 * while i < links_len: * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: # <<<<<<<<<<<<<< @@ -64876,24 +63532,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * nt_i += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __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_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_14 = __pyx_t_13; } else { @@ -64901,79 +63557,79 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } if (!__pyx_t_14) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2119 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2079 * while i < links_len: * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: * off += (nt[nt_i][2] - nt[nt_i][1]) # <<<<<<<<<<<<<< * nt_i += 1 * links[i][0] -= off */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __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_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __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; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2120 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2080 * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: * off += (nt[nt_i][2] - nt[nt_i][1]) * nt_i += 1 # <<<<<<<<<<<<<< * links[i][0] -= off * i += 1 */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2121 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2081 * off += (nt[nt_i][2] - nt[nt_i][1]) * nt_i += 1 * links[i][0] -= off # <<<<<<<<<<<<<< * i += 1 * nt_i = 0 */ - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_4, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_4, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2122 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2082 * nt_i += 1 * links[i][0] -= off * i += 1 # <<<<<<<<<<<<<< * nt_i = 0 * off = e_i */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2123 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2083 * links[i][0] -= off * i += 1 * nt_i = 0 # <<<<<<<<<<<<<< @@ -64983,7 +63639,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2124 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2084 * i += 1 * nt_i = 0 * off = e_i # <<<<<<<<<<<<<< @@ -64993,7 +63649,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_e_i); __Pyx_DECREF_SET(__pyx_v_off, __pyx_v_e_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2125 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2085 * nt_i = 0 * off = e_i * i = 0 # <<<<<<<<<<<<<< @@ -65003,7 +63659,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2126 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2086 * off = e_i * i = 0 * while i < links_len: # <<<<<<<<<<<<<< @@ -65011,12 +63667,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) */ while (1) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_14) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2127 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2087 * i = 0 * while i < links_len: * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: # <<<<<<<<<<<<<< @@ -65024,24 +63680,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * nt_i += 1 */ while (1) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_14) { - __pyx_t_2 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __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_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__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 = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = __pyx_t_7; } else { @@ -65049,79 +63705,79 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } if (!__pyx_t_13) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2128 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2088 * while i < links_len: * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) # <<<<<<<<<<<<<< * nt_i += 1 * links_inv[i][1] -= off */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __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_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2129 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2089 * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) * nt_i += 1 # <<<<<<<<<<<<<< * links_inv[i][1] -= off * i += 1 */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_t_3); __pyx_t_3 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2130 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2090 * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) * nt_i += 1 * links_inv[i][1] -= off # <<<<<<<<<<<<<< * i += 1 * */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetItemInt(__pyx_t_3, __pyx_t_4, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_3, __pyx_t_4, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2131 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2091 * nt_i += 1 * links_inv[i][1] -= off * i += 1 # <<<<<<<<<<<<<< * * # Find lexical span */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2134 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2094 * * # Find lexical span * lex_f_i = f_i # <<<<<<<<<<<<<< @@ -65131,75 +63787,75 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_f_i); __pyx_v_lex_f_i = __pyx_v_f_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2135 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2095 * # Find lexical span * lex_f_i = f_i * lex_f_j = f_i + (len(f_span) - 1) # <<<<<<<<<<<<<< * if nt: * if nt[0][1] == lex_f_i: */ - __pyx_t_4 = PyObject_Length(__pyx_v_f_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_v_f_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Add(__pyx_v_f_i, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_f_i, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_lex_f_j = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2136 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2096 * lex_f_i = f_i * lex_f_j = f_i + (len(f_span) - 1) * if nt: # <<<<<<<<<<<<<< * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 */ - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2137 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2097 * lex_f_j = f_i + (len(f_span) - 1) * if nt: * if nt[0][1] == lex_f_i: # <<<<<<<<<<<<<< * lex_f_i += (nt[0][2] - nt[0][1]) + 1 * if nt[-1][2] == lex_f_j: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __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_RichCompare(__pyx_t_3, __pyx_v_lex_f_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_lex_f_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2138 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2098 * if nt: * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 # <<<<<<<<<<<<<< * if nt[-1][2] == lex_f_j: * lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __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; - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_lex_f_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_lex_f_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_lex_f_i, __pyx_t_1); @@ -65208,49 +63864,49 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2139 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2099 * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 * if nt[-1][2] == lex_f_j: # <<<<<<<<<<<<<< * lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lex_f_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lex_f_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2140 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2100 * lex_f_i += (nt[0][2] - nt[0][1]) + 1 * if nt[-1][2] == lex_f_j: * lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 # <<<<<<<<<<<<<< * * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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_InPlaceSubtract(__pyx_v_lex_f_j, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_lex_f_j, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_lex_f_j, __pyx_t_1); @@ -65262,63 +63918,63 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __pyx_L23:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2143 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2103 * * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) * f = Phrase(f_sym) # <<<<<<<<<<<<<< * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __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 = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f_sym)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f_sym)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f_sym)); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2144 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2104 * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) * f = Phrase(f_sym) * e = Phrase(e_sym) # <<<<<<<<<<<<<< * a = tuple(self.alignment.link(i, j) for i, j in links) * return (f, e, a, lex_f_i, lex_f_j) */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __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 = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_e_sym)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_e_sym)); __Pyx_GIVEREF(((PyObject *)__pyx_v_e_sym)); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_v_e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<< * return (f, e, a, lex_f_i, lex_f_j) * */ - __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __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[8]; __pyx_lineno = 2145; __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 = 2105; __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*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_v_a = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2146 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2106 * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) * return (f, e, a, lex_f_i, lex_f_j) # <<<<<<<<<<<<<< @@ -65326,7 +63982,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * # Rule string from rule */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); @@ -65414,16 +64070,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fmt_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fmt_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -65438,7 +64094,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.fmt_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -65450,7 +64106,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py } static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2150 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110 * # Rule string from rule * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<< @@ -65476,7 +64132,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_gen __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -65518,13 +64174,13 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_a; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -65532,23 +64188,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -65558,24 +64214,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_packed, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_150), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_150), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment), __pyx_n_s__unlink); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment), __pyx_n_s__unlink); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_packed); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_packed); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_packed); - __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; @@ -65596,7 +64252,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetNone(PyExc_StopIteration); @@ -65616,7 +64272,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2149 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2109 * * # Rule string from rule * def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<< @@ -65649,30 +64305,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2150 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110 * # Rule string from rule * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<< * return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __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 = 2150; __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 = 2110; __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 = 2150; __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[8]; __pyx_lineno = 2110; __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; __pyx_v_a_str = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2151 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2111 * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) * return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) # <<<<<<<<<<<<<< @@ -65680,9 +64336,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st * # Lookup online stats for phrase pair (f, e). Return None if no match. */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_151), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_151), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __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 = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f); @@ -65693,7 +64349,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st __Pyx_INCREF(__pyx_v_a_str); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_a_str); __Pyx_GIVEREF(__pyx_v_a_str); - __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 = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2111; __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; @@ -65733,7 +64389,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__ctx_name,0}; PyObject* values[3] = {0,0,0}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2155 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2115 * # Lookup online stats for phrase pair (f, e). Return None if no match. * # IMPORTANT: use get() to avoid adding items to defaultdict * def online_ctx_lookup(self, f, e, ctx_name=None): # <<<<<<<<<<<<<< @@ -65759,7 +64415,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { @@ -65768,7 +64424,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "online_ctx_lookup") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "online_ctx_lookup") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -65785,7 +64441,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.online_ctx_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -65809,13 +64465,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("online_ctx_lookup", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2156 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2116 * # IMPORTANT: use get() to avoid adding items to defaultdict * def online_ctx_lookup(self, f, e, ctx_name=None): * if self.online: # <<<<<<<<<<<<<< @@ -65825,31 +64480,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __pyx_t_1 = (__pyx_v_self->online != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2157 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2117 * def online_ctx_lookup(self, f, e, ctx_name=None): * if self.online: * stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<< * fcount = stats.phrases_f.get(f, 0) * fsample_count = stats.samples_f.get(f, 0) */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_stats = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2158 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2118 * if self.online: * stats = self.online_stats[ctx_name] * fcount = stats.phrases_f.get(f, 0) # <<<<<<<<<<<<<< * fsample_count = stats.samples_f.get(f, 0) * d = stats.phrases_fe.get(f, None) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __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 = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f); @@ -65857,26 +64512,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_fcount = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2159 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2119 * stats = self.online_stats[ctx_name] * fcount = stats.phrases_f.get(f, 0) * fsample_count = stats.samples_f.get(f, 0) # <<<<<<<<<<<<<< * d = stats.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f); @@ -65884,26 +64539,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_v_fsample_count = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2160 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2120 * fcount = stats.phrases_f.get(f, 0) * fsample_count = stats.samples_f.get(f, 0) * d = stats.phrases_fe.get(f, None) # <<<<<<<<<<<<<< * paircount = d.get(e, 0) if d else 0 - * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe) + * return OnlineFeatureContext(fcount, fsample_count, paircount) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f); @@ -65911,25 +64566,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None); __Pyx_GIVEREF(Py_None); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_v_d = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2161 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2121 * fsample_count = stats.samples_f.get(f, 0) * d = stats.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 # <<<<<<<<<<<<<< - * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe) + * return OnlineFeatureContext(fcount, fsample_count, paircount) * return None */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __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[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_e); @@ -65937,7 +64592,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __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[8]; __pyx_lineno = 2121; __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; @@ -65950,56 +64605,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __pyx_v_paircount = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2162 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2122 * d = stats.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 - * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe) # <<<<<<<<<<<<<< + * return OnlineFeatureContext(fcount, fsample_count, paircount) # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_152); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_152); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_f); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_e); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_fcount); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_fcount); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fcount); __Pyx_GIVEREF(__pyx_v_fcount); __Pyx_INCREF(__pyx_v_fsample_count); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_fsample_count); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_fsample_count); __Pyx_GIVEREF(__pyx_v_fsample_count); __Pyx_INCREF(__pyx_v_paircount); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_paircount); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_paircount); __Pyx_GIVEREF(__pyx_v_paircount); - PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_5 = 0; - __pyx_t_4 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __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_6)); __pyx_t_6 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2163 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2123 * paircount = d.get(e, 0) if d else 0 - * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe) + * return OnlineFeatureContext(fcount, fsample_count, paircount) * return None # <<<<<<<<<<<<<< * * # Find all phrases that we might try to extract @@ -66016,7 +64656,6 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.online_ctx_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -66083,36 +64722,36 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ntc)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__syms)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -66135,7 +64774,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_f_phrases.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -66146,7 +64785,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2133 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< @@ -66179,33 +64818,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2175 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2135 * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<< * return * # Extend with word */ - if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __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 = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) { - __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_t_5; } else { @@ -66213,7 +64852,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2176 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2136 * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: * return # <<<<<<<<<<<<<< @@ -66227,58 +64866,58 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2178 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2138 * return * # Extend with word * if wc + ntc < self.max_length: # <<<<<<<<<<<<<< * syms.append(f_words[f_j]) * f = Phrase(syms) */ - __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2139 * # Extend with word * if wc + ntc < self.max_length: * syms.append(f_words[f_j]) # <<<<<<<<<<<<<< * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2180 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2140 * if wc + ntc < self.max_length: * syms.append(f_words[f_j]) * f = Phrase(syms) # <<<<<<<<<<<<<< * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __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 = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_syms); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_syms); __Pyx_GIVEREF(__pyx_v_syms); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2181 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2141 * syms.append(f_words[f_j]) * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) # <<<<<<<<<<<<<< @@ -66289,8 +64928,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_t_1 = __pyx_v_f_j; __Pyx_INCREF(__pyx_v_lex_i); __pyx_t_2 = __pyx_v_lex_i; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); @@ -66307,7 +64946,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_v_new_lex_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2182 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2142 * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) # <<<<<<<<<<<<<< @@ -66318,8 +64957,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_t_1 = __pyx_v_f_j; __Pyx_INCREF(__pyx_v_lex_j); __pyx_t_4 = __pyx_v_lex_j; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); @@ -66336,19 +64975,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_v_new_lex_j = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2183 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2143 * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) * phrases.add((f, new_lex_i, new_lex_j)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) * syms.pop() */ - if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_phrases) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); @@ -66359,53 +64998,53 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __Pyx_INCREF(__pyx_v_new_lex_j); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_new_lex_j); __Pyx_GIVEREF(__pyx_v_new_lex_j); - __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2184 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2144 * new_lex_j = max(lex_j, f_j) * phrases.add((f, new_lex_i, new_lex_j)) * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) # <<<<<<<<<<<<<< * syms.pop() * # Extend with existing non-terminal */ - __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_lex_i, __pyx_v_new_lex_j, __pyx_t_2, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_lex_i, __pyx_v_new_lex_j, __pyx_t_2, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 * phrases.add((f, new_lex_i, new_lex_j)) * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) * syms.pop() # <<<<<<<<<<<<<< * # Extend with existing non-terminal * if syms and sym_isvar(syms[-1]): */ - __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4; } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2187 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2147 * syms.pop() * # Extend with existing non-terminal * if syms and sym_isvar(syms[-1]): # <<<<<<<<<<<<<< * # Don't re-extract the same phrase * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_9) != 0); } else { @@ -66413,17 +65052,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2189 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2149 * if syms and sym_isvar(syms[-1]): * # Don't re-extract the same phrase * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) # <<<<<<<<<<<<<< * # Extend with new non-terminal * if wc + ntc < self.max_length: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __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; @@ -66431,44 +65070,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2191 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2151 * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) * # Extend with new non-terminal * if wc + ntc < self.max_length: # <<<<<<<<<<<<<< * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): * syms.append(sym_setindex(self.category, ntc + 1)) */ - __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __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[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2192 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2152 * # Extend with new non-terminal * if wc + ntc < self.max_length: * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): # <<<<<<<<<<<<<< * syms.append(sym_setindex(self.category, ntc + 1)) * f = Phrase(syms) */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (!__pyx_t_3); if (!__pyx_t_6) { - __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_9) != 0)); __pyx_t_10 = __pyx_t_5; @@ -66481,67 +65120,67 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2193 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2153 * if wc + ntc < self.max_length: * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): * syms.append(sym_setindex(self.category, ntc + 1)) # <<<<<<<<<<<<<< * f = Phrase(syms) * if wc > 0: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2194 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2154 * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): * syms.append(sym_setindex(self.category, ntc + 1)) * f = Phrase(syms) # <<<<<<<<<<<<<< * if wc > 0: * phrases.add((f, lex_i, lex_j)) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __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 = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_syms); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_syms); __Pyx_GIVEREF(__pyx_v_syms); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_f, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_4)); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2195 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2155 * syms.append(sym_setindex(self.category, ntc + 1)) * f = Phrase(syms) * if wc > 0: # <<<<<<<<<<<<<< * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2196 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2156 * f = Phrase(syms) * if wc > 0: * phrases.add((f, lex_i, lex_j)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) * syms.pop() */ - if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_phrases) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_f)); @@ -66552,38 +65191,38 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __Pyx_INCREF(__pyx_v_lex_j); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_lex_j); __Pyx_GIVEREF(__pyx_v_lex_j); - __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; goto __pyx_L8; } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2197 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2157 * if wc > 0: * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) # <<<<<<<<<<<<<< * syms.pop() * */ - __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_t_1, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_t_1, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __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_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2198 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2158 * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) * syms.pop() # <<<<<<<<<<<<<< * * # Try to extract phrases from every f index */ - __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L7; @@ -66611,7 +65250,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2128 * # (Used for EGivenFCoherent) * # Return set of (fphrase, lex_i, lex_j) * def get_f_phrases(self, f_words): # <<<<<<<<<<<<<< @@ -66648,7 +65287,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2170 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2130 * def get_f_phrases(self, f_words): * * f_len = len(f_words) # <<<<<<<<<<<<<< @@ -66657,66 +65296,66 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_f_words; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __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[8]; __pyx_lineno = 2130; __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[8]; __pyx_lineno = 2170; __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[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_f_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2131 * * f_len = len(f_words) * phrases = set() # (fphrase, lex_i, lex_j) # <<<<<<<<<<<<<< * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_cur_scope->__pyx_v_phrases = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2133 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, __pyx_n_s_155, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_154)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, __pyx_n_s_155, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_154)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2201 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2161 * * # Try to extract phrases from every f index * for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<< * extract(f_i, f_i, f_len, -1, 0, 0, []) * */ - __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_3; __pyx_v_f_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2202 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2162 * # Try to extract phrases from every f index * for f_i from 0 <= f_i < f_len: * extract(f_i, f_i, f_len, -1, 0, 0, []) # <<<<<<<<<<<<<< * * return phrases */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_v_f_len; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -66725,7 +65364,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2204 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2164 * extract(f_i, f_i, f_len, -1, 0, 0, []) * * return phrases # <<<<<<<<<<<<<< @@ -66768,7 +65407,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ctx_name,0}; PyObject* values[1] = {0}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2207 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2167 * * # Drop online stats for a context * def drop_ctx(self, ctx_name=None): # <<<<<<<<<<<<<< @@ -66793,7 +65432,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drop_ctx") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drop_ctx") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -66806,7 +65445,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("drop_ctx", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("drop_ctx", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.drop_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -66828,16 +65467,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("drop_ctx", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2208 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168 * # Drop online stats for a context * def drop_ctx(self, ctx_name=None): * self.online_stats.pop(ctx_name, None) # <<<<<<<<<<<<<< * * # Spans are _inclusive_ on both ends [i, j] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->online_stats, __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->online_stats, __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __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 = 2208; __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 = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ctx_name); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ctx_name); @@ -66845,7 +65484,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); __Pyx_GIVEREF(Py_None); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __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[8]; __pyx_lineno = 2168; __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; @@ -66899,16 +65538,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_check") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_check") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -66923,7 +65562,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.span_check", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -66934,7 +65573,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2211 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171 * * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): # <<<<<<<<<<<<<< @@ -66953,7 +65592,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_check", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2212 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2172 * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -66963,7 +65602,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2213 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173 * def span_check(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -66971,25 +65610,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ * return False */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __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[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __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[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2214 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2174 * k = i * while k <= j: * if vec[k]: # <<<<<<<<<<<<<< * return False * k += 1 */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_vec, __pyx_v_k); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_vec, __pyx_v_k); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __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[8]; __pyx_lineno = 2214; __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[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2215 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2175 * while k <= j: * if vec[k]: * return False # <<<<<<<<<<<<<< @@ -66997,7 +65636,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ * return True */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -67006,20 +65645,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2216 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2176 * if vec[k]: * return False * k += 1 # <<<<<<<<<<<<<< * return True * */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2217 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2177 * return False * k += 1 * return True # <<<<<<<<<<<<<< @@ -67027,7 +65666,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ * def span_inc(vec, i, j): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -67080,16 +65719,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_inc") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_inc") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -67104,7 +65743,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.span_inc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -67115,7 +65754,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2219 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< @@ -67136,7 +65775,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_inc", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2220 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2180 * * def span_inc(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -67146,7 +65785,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2221 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2181 * def span_inc(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -67154,12 +65793,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py * k += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2221; __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[8]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __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[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2222 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2182 * k = i * while k <= j: * vec[k] += 1 # <<<<<<<<<<<<<< @@ -67168,23 +65807,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py */ __Pyx_INCREF(__pyx_v_k); __pyx_t_1 = __pyx_v_k; - __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2223 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2183 * while k <= j: * vec[k] += 1 * k += 1 # <<<<<<<<<<<<<< * * def span_dec(vec, i, j): */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; @@ -67239,16 +65878,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_dec") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_dec") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -67263,7 +65902,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.span_dec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -67274,7 +65913,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2225 +/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< @@ -67295,7 +65934,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_dec", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2226 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2186 * * def span_dec(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -67305,7 +65944,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2227 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2187 * def span_dec(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -67313,12 +65952,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py * k += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2227; __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[8]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __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[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2228 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2188 * k = i * while k <= j: * vec[k] -= 1 # <<<<<<<<<<<<<< @@ -67326,21 +65965,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py */ __Pyx_INCREF(__pyx_v_k); __pyx_t_1 = __pyx_v_k; - __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2229 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2189 * while k <= j: * vec[k] -= 1 * k += 1 # <<<<<<<<<<<<<< */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; @@ -69005,10 +67644,6 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_OnlineStats(PyTypeObject *t, CYTHON p->phrases_e = Py_None; Py_INCREF(Py_None); p->phrases_fe = Py_None; Py_INCREF(Py_None); p->phrases_al = Py_None; Py_INCREF(Py_None); - p->bilex_f = Py_None; Py_INCREF(Py_None); - p->bilex_e = Py_None; Py_INCREF(Py_None); - p->bilex_fe = Py_None; Py_INCREF(Py_None); - p->bilex_ef = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } @@ -69023,10 +67658,6 @@ static void __pyx_tp_dealloc_4cdec_2sa_3_sa_OnlineStats(PyObject *o) { Py_CLEAR(p->phrases_e); Py_CLEAR(p->phrases_fe); Py_CLEAR(p->phrases_al); - Py_CLEAR(p->bilex_f); - Py_CLEAR(p->bilex_e); - Py_CLEAR(p->bilex_fe); - Py_CLEAR(p->bilex_ef); (*Py_TYPE(o)->tp_free)(o); } @@ -69048,18 +67679,6 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa_OnlineStats(PyObject *o, visitproc v if (p->phrases_al) { e = (*v)(p->phrases_al, a); if (e) return e; } - if (p->bilex_f) { - e = (*v)(p->bilex_f, a); if (e) return e; - } - if (p->bilex_e) { - e = (*v)(p->bilex_e, a); if (e) return e; - } - if (p->bilex_fe) { - e = (*v)(p->bilex_fe, a); if (e) return e; - } - if (p->bilex_ef) { - e = (*v)(p->bilex_ef, a); if (e) return e; - } return 0; } @@ -69081,18 +67700,6 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa_OnlineStats(PyObject *o) { tmp = ((PyObject*)p->phrases_al); p->phrases_al = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->bilex_f); - p->bilex_f = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->bilex_e); - p->bilex_e = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->bilex_fe); - p->bilex_fe = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->bilex_ef); - p->bilex_ef = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); return 0; } @@ -69161,58 +67768,6 @@ static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al(PyObject *o, Py } } -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_f(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_f(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_5__del__(o); - } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_e(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_e(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_5__del__(o); - } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_fe(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_fe(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_5__del__(o); - } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_ef(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_ef(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_5__del__(o); - } -} - static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_OnlineStats[] = { {0, 0, 0, 0} }; @@ -69223,10 +67778,6 @@ static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_OnlineStats[] = { {(char *)"phrases_e", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e, 0, 0}, {(char *)"phrases_fe", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe, 0, 0}, {(char *)"phrases_al", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al, 0, 0}, - {(char *)"bilex_f", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_f, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_f, 0, 0}, - {(char *)"bilex_e", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_e, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_e, 0, 0}, - {(char *)"bilex_fe", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_fe, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_fe, 0, 0}, - {(char *)"bilex_ef", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_ef, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_ef, 0, 0}, {0, 0, 0, 0, 0} }; @@ -76224,10 +74775,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__arr, __pyx_k__arr, sizeof(__pyx_k__arr), 0, 0, 1, 1}, {&__pyx_n_s__arr_high, __pyx_k__arr_high, sizeof(__pyx_k__arr_high), 0, 0, 1, 1}, {&__pyx_n_s__arr_low, __pyx_k__arr_low, sizeof(__pyx_k__arr_low), 0, 0, 1, 1}, - {&__pyx_n_s__bilex_e, __pyx_k__bilex_e, sizeof(__pyx_k__bilex_e), 0, 0, 1, 1}, - {&__pyx_n_s__bilex_ef, __pyx_k__bilex_ef, sizeof(__pyx_k__bilex_ef), 0, 0, 1, 1}, - {&__pyx_n_s__bilex_f, __pyx_k__bilex_f, sizeof(__pyx_k__bilex_f), 0, 0, 1, 1}, - {&__pyx_n_s__bilex_fe, __pyx_k__bilex_fe, sizeof(__pyx_k__bilex_fe), 0, 0, 1, 1}, {&__pyx_n_s__by_slack_factor, __pyx_k__by_slack_factor, sizeof(__pyx_k__by_slack_factor), 0, 0, 1, 1}, {&__pyx_n_s__category, __pyx_k__category, sizeof(__pyx_k__category), 0, 0, 1, 1}, {&__pyx_n_s__chain, __pyx_k__chain, sizeof(__pyx_k__chain), 0, 0, 1, 1}, @@ -76462,8 +75009,8 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__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_GetBuiltinName(__pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -76978,106 +75525,106 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_k_tuple_100); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":147 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":133 * logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) * else: * logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<< * * def sample(self, PhraseLocation phrase_location): */ - __pyx_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_105)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_105)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_106); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_106)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":360 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":346 * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: * raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<< * self.alignment = alignment * */ - __pyx_k_tuple_111 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_110)); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_111 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_110)); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_111); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_111)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1072 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1058 * else: * #ERROR: We never get here * raise Exception("Keyword trie error") # <<<<<<<<<<<<<< * # checking whether lookup_required * if lookup_required: */ - __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_126)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_126)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_127); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_127)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1991 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1977 * if nt and nt[-1][2] == f_j - 1: * # Add to non-terminal, checking for collisions * old_last_nt = nt[-1][:] # <<<<<<<<<<<<<< * nt[-1][2] = f_j * if link_i < nt[-1][3]: */ - __pyx_k_slice_141 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_141)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_slice_141 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_141)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_slice_141); __Pyx_GIVEREF(__pyx_k_slice_141); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1928 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914 * # f_ i and j are current, e_ i and j are previous * # We care _considering_ f_j, so it is not yet in counts * def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<< * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: */ - __pyx_k_tuple_142 = PyTuple_Pack(19, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__e_i), ((PyObject *)__pyx_n_s__e_j), ((PyObject *)__pyx_n_s__min_bound), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__links), ((PyObject *)__pyx_n_s__nt), ((PyObject *)__pyx_n_s__nt_open), ((PyObject *)__pyx_n_s__link_i), ((PyObject *)__pyx_n_s__link_j), ((PyObject *)__pyx_n_s__new_e_i), ((PyObject *)__pyx_n_s__new_e_j), ((PyObject *)__pyx_n_s__new_min_bound), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__nt_collision), ((PyObject *)__pyx_n_s__link), ((PyObject *)__pyx_n_s__plus_links), ((PyObject *)__pyx_n_s__old_last_nt)); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_142 = PyTuple_Pack(19, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__e_i), ((PyObject *)__pyx_n_s__e_j), ((PyObject *)__pyx_n_s__min_bound), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__links), ((PyObject *)__pyx_n_s__nt), ((PyObject *)__pyx_n_s__nt_open), ((PyObject *)__pyx_n_s__link_i), ((PyObject *)__pyx_n_s__link_j), ((PyObject *)__pyx_n_s__new_e_i), ((PyObject *)__pyx_n_s__new_e_j), ((PyObject *)__pyx_n_s__new_min_bound), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__nt_collision), ((PyObject *)__pyx_n_s__link), ((PyObject *)__pyx_n_s__plus_links), ((PyObject *)__pyx_n_s__old_last_nt)); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_142); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142)); - __pyx_k_codeobj_143 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 1928, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_143)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_143 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 1914, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_143)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2050 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2036 * # Update phrase counts * for rule in rules: * (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<< * stats.phrases_f[f_ph] += 1 * stats.phrases_e[e_ph] += 1 */ - __pyx_k_slice_146 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_k_slice_146)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_slice_146 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_k_slice_146)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_slice_146); __Pyx_GIVEREF(__pyx_k_slice_146); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2088 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2048 * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) # <<<<<<<<<<<<<< * off = f_i * for next_nt in nt: */ - __pyx_k_slice_148 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_slice_148 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_slice_148); __Pyx_GIVEREF(__pyx_k_slice_148); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2098 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2058 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) * e_sym = list(e_span[:]) # <<<<<<<<<<<<<< * off = e_i * for next_nt in nt_inv: */ - __pyx_k_slice_149 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_slice_149 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_slice_149); __Pyx_GIVEREF(__pyx_k_slice_149); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2133 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: */ - __pyx_k_tuple_153 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__lex_i), ((PyObject *)__pyx_n_s__lex_j), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__ntc), ((PyObject *)__pyx_n_s__syms), ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__new_lex_i), ((PyObject *)__pyx_n_s__new_lex_j)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_153 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__lex_i), ((PyObject *)__pyx_n_s__lex_j), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__ntc), ((PyObject *)__pyx_n_s__syms), ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__new_lex_i), ((PyObject *)__pyx_n_s__new_lex_j)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_153); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153)); - __pyx_k_codeobj_154 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 2173, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_154 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 2133, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "cdec/sa/_sa.pyx":5 * import gzip @@ -77182,41 +75729,41 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_174)); __pyx_k_codeobj_175 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_165, __pyx_n_s__decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_175)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2211 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171 * * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_177 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_177 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_177); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_177)); - __pyx_k_codeobj_178 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_check, 2211, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_178 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_check, 2171, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2219 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_179 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_179 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_179); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_179)); - __pyx_k_codeobj_180 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_inc, 2219, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_180)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_180 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_inc, 2179, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_180)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2225 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_181 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_181)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_181 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_181)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_181); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_181)); - __pyx_k_codeobj_182 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_dec, 2225, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_182)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_182 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_dec, 2185, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_182)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -77343,15 +75890,15 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_ptype_4cdec_2sa_3_sa_SuffixArray = &__pyx_type_4cdec_2sa_3_sa_SuffixArray; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule; if (PyType_Ready(&__pyx_type_4cdec_2sa_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_4cdec_2sa_3_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_LCP = &__pyx_type_4cdec_2sa_3_sa_LCP; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "OnlineStats", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "OnlineStats", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_OnlineStats = &__pyx_type_4cdec_2sa_3_sa_OnlineStats; __pyx_vtabptr_4cdec_2sa_3_sa_IntList = &__pyx_vtable_4cdec_2sa_3_sa_IntList; __pyx_vtable_4cdec_2sa_3_sa_IntList.set = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, int, int))__pyx_f_4cdec_2sa_3_sa_7IntList_set; @@ -77372,8 +75919,8 @@ PyMODINIT_FUNC PyInit__sa(void) if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Phrase.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_Phrase = &__pyx_type_4cdec_2sa_3_sa_Phrase; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_TrieNode = &__pyx_type_4cdec_2sa_3_sa_TrieNode; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr; @@ -77381,11 +75928,11 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases; __pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode.tp_base = __pyx_ptype_4cdec_2sa_3_sa_TrieNode; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode = &__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode; __pyx_vtabptr_4cdec_2sa_3_sa_Alignment = &__pyx_vtable_4cdec_2sa_3_sa_Alignment; __pyx_vtable_4cdec_2sa_3_sa_Alignment.link = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *, int, int))__pyx_f_4cdec_2sa_3_sa_9Alignment_link; @@ -77395,16 +75942,16 @@ PyMODINIT_FUNC PyInit__sa(void) if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Alignment.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "Alignment", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_Alignment = &__pyx_type_4cdec_2sa_3_sa_Alignment; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_input = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "Rule", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_Rule = &__pyx_type_4cdec_2sa_3_sa_Rule; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr; __pyx_vtabptr_4cdec_2sa_3_sa_Precomputation = &__pyx_vtable_4cdec_2sa_3_sa_Precomputation; __pyx_vtable_4cdec_2sa_3_sa_Precomputation.read_map = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *, FILE *))__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map; @@ -77415,7 +75962,7 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_ptype_4cdec_2sa_3_sa_Precomputation = &__pyx_type_4cdec_2sa_3_sa_Precomputation; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance; __pyx_vtabptr_4cdec_2sa_3_sa_TrieMap = &__pyx_vtable_4cdec_2sa_3_sa_TrieMap; __pyx_vtable_4cdec_2sa_3_sa_TrieMap._insert = (struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *(*)(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *, int *, int))__pyx_f_4cdec_2sa_3_sa_7TrieMap__insert; @@ -77450,18 +75997,18 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_TrieTable = &__pyx_type_4cdec_2sa_3_sa_TrieTable; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr; @@ -77477,9 +76024,9 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice; __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation = &__pyx_vtable_4cdec_2sa_3_sa_PhraseLocation; __pyx_vtable_4cdec_2sa_3_sa_PhraseLocation.contains = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *, int))__pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation = &__pyx_type_4cdec_2sa_3_sa_PhraseLocation; __pyx_vtabptr_4cdec_2sa_3_sa_Scorer = &__pyx_vtable_4cdec_2sa_3_sa_Scorer; __pyx_vtable_4cdec_2sa_3_sa_Scorer.score = (struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Scorer *, PyObject *))__pyx_f_4cdec_2sa_3_sa_6Scorer_score; @@ -77487,8 +76034,8 @@ PyMODINIT_FUNC PyInit__sa(void) if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Scorer.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_Scorer) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "Scorer", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Scorer) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_Scorer = &__pyx_type_4cdec_2sa_3_sa_Scorer; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_Sampler = &__pyx_type_4cdec_2sa_3_sa_Sampler; __pyx_vtabptr_4cdec_2sa_3_sa_Alphabet = &__pyx_vtable_4cdec_2sa_3_sa_Alphabet; __pyx_vtable_4cdec_2sa_3_sa_Alphabet.isvar = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *, int))__pyx_f_4cdec_2sa_3_sa_8Alphabet_isvar; @@ -77542,9 +76089,9 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory.extract_phrases = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int, int, int, int *, int *, int *, int, int, int))__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrases; __pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory.create_alignments = (struct __pyx_obj_4cdec_2sa_3_sa_IntList *(*)(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *, int *, int, struct __pyx_obj_4cdec_2sa_3_sa_IntList *, struct __pyx_obj_4cdec_2sa_3_sa_IntList *))__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_create_alignments; __pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory.extract = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_4cdec_2sa_3_sa_Phrase *, struct __pyx_t_4cdec_2sa_3_sa_Matching *, int *, int))__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_HieroCachingRuleFactory = &__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__; @@ -77942,7 +76489,7 @@ PyMODINIT_FUNC PyInit__sa(void) * 'fsample_count', * 'paircount', */ - __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_n_s__fcount)); PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__fcount)); @@ -77953,18 +76500,6 @@ PyMODINIT_FUNC PyInit__sa(void) __Pyx_INCREF(((PyObject *)__pyx_n_s__paircount)); PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_n_s__paircount)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__paircount)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__bilex_f)); - PyList_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_n_s__bilex_f)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bilex_f)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__bilex_e)); - PyList_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_n_s__bilex_e)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bilex_e)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__bilex_fe)); - PyList_SET_ITEM(__pyx_t_3, 5, ((PyObject *)__pyx_n_s__bilex_fe)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bilex_fe)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__bilex_ef)); - PyList_SET_ITEM(__pyx_t_3, 6, ((PyObject *)__pyx_n_s__bilex_ef)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bilex_ef)); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_n_s_152)); @@ -77980,8 +76515,8 @@ PyMODINIT_FUNC PyInit__sa(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_152, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":67 - * self.bilex_ef = defaultdict(lambda: defaultdict(int)) + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":53 + * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) * * cdef int PRECOMPUTE = 0 # <<<<<<<<<<<<<< * cdef int MERGE = 1 @@ -77989,7 +76524,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_4cdec_2sa_3_sa_PRECOMPUTE = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":68 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":54 * * cdef int PRECOMPUTE = 0 * cdef int MERGE = 1 # <<<<<<<<<<<<<< @@ -77998,7 +76533,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_4cdec_2sa_3_sa_MERGE = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":69 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":55 * cdef int PRECOMPUTE = 0 * cdef int MERGE = 1 * cdef int BAEZA_YATES = 2 # <<<<<<<<<<<<<< @@ -78007,7 +76542,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_4cdec_2sa_3_sa_BAEZA_YATES = 2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":72 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":58 * * # NOTE: was encoded as a non-terminal in the previous version * cdef int EPSILON = sym_fromstring('*EPS*', True) # <<<<<<<<<<<<<< @@ -78016,53 +76551,53 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_4cdec_2sa_3_sa_EPSILON = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_k_176, 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":95 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":81 * cdef public int count * cdef public root * def __cinit__(self, extended=False): # <<<<<<<<<<<<<< * self.count = 0 * self.extended = extended */ - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_k_103 = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2211 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171 * * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_17span_check, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_17span_check, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_check, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_check, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2219 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_19span_inc, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_19span_inc, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_inc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_inc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2225 + /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_21span_dec, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_21span_dec, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_dec, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_dec, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":1 diff --git a/python/cdec/sa/compile.py b/python/cdec/sa/compile.py index 3cdf212f..a5bd0699 100644 --- a/python/cdec/sa/compile.py +++ b/python/cdec/sa/compile.py @@ -132,9 +132,11 @@ def main(): start_time = monitor_cpu() logger.info('Compiling online bilexical dictionary') if args.bitext: - bilex = cdec.sa.online.Bilex(alignment_f=args.alignment, text_f=args.bitext) + bilex = cdec.sa.online.Bilex() + bilex.add_bitext(args.alignment, args.bitext) else: - bilex = cdec.sa.online.Bilex(alignment_f=args.alignment, text_f=args.source, text_target_f=args.target) + bilex = cdec.sa.online.Bilex() + bilex.add_bitext(args.alignment, args.source, args.target) bilex.write(bilex_file) stop_time = monitor_cpu() logger.info('Compiling online bilexical dictionary took %f seconds', stop_time - start_time) diff --git a/python/cdec/sa/extractor.py b/python/cdec/sa/extractor.py index 25313cc3..c2ded1d6 100644 --- a/python/cdec/sa/extractor.py +++ b/python/cdec/sa/extractor.py @@ -4,7 +4,7 @@ import cdec.configobj from cdec.sa._sa import gzip_or_text from cdec.sa.features import EgivenFCoherent, SampleCountF, CountEF,\ MaxLexEgivenF, MaxLexFgivenE, IsSingletonF, IsSingletonFE,\ - IsSupportedOnline, CountExceptLM + IsSupportedOnline import cdec.sa # maximum span of a grammar rule in TEST DATA @@ -57,16 +57,16 @@ class GrammarExtractor: ) # lexical weighting tables - tt = cdec.sa.BiLex(from_binary=config['lex_file']) + if not online: + tt = cdec.sa.BiLex(from_binary=config['lex_file']) + else: + tt = cdec.sa.online.Bilex(config['bilex_file']) # TODO: clean this up # Load data and add features for online grammar extraction extended_features = [] if online: extended_features.append(IsSupportedOnline) - vocab_file = config['vocab_file'] - vcb_set = set(line.strip() for line in gzip_or_text(vocab)) - extended_features.append(CountExceptLM(vcb_set)) # TODO: use @cdec.sa.features decorator for standard features too # + add a mask to disable features diff --git a/python/cdec/sa/features.py b/python/cdec/sa/features.py index 3e6af859..1779f2f9 100644 --- a/python/cdec/sa/features.py +++ b/python/cdec/sa/features.py @@ -44,60 +44,22 @@ def MaxLexEgivenF(ttable): def MaxLexEgivenF(ctx): fwords = ctx.fphrase.words fwords.append('NULL') - # Always use this for now - if not ctx.online or ctx.online: - maxOffScore = 0.0 - for e in ctx.ephrase.words: - maxScore = max(ttable.get_score(f, e, 0) for f in fwords) - maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE - return maxOffScore - else: - # For now, straight average - maxOffScore = 0.0 - maxOnScore = 0.0 - for e in ctx.ephrase.words: - maxScore = max(ttable.get_score(f, e, 0) for f in fwords) - maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE - for e in ctx.ephrase: - if not isvar(e): - maxScore = 0.0 - for f in ctx.fphrase: - if not isvar(f): - b_f = ctx.online.bilex_f.get(f, 0) - if b_f: - maxScore = max(maxScore, ctx.online.bilex_fe.get(f, {}).get(e)) - maxOnScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE - return (maxOffScore + maxOnScore) / 2 + maxOffScore = 0.0 + for e in ctx.ephrase.words: + maxScore = max(ttable.get_score(f, e, 0) for f in fwords) + maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE + return maxOffScore return MaxLexEgivenF def MaxLexFgivenE(ttable): def MaxLexFgivenE(ctx): ewords = ctx.ephrase.words ewords.append('NULL') - # Always use this for now - if not ctx.online or ctx.online: - maxOffScore = 0.0 - for f in ctx.fphrase.words: - maxScore = max(ttable.get_score(f, e, 1) for e in ewords) - maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE - return maxOffScore - else: - # For now, straight average - maxOffScore = 0.0 - maxOnScore = 0.0 - for f in ctx.fphrase.words: - maxScore = max(ttable.get_score(f, e, 1) for e in ewords) - maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE - for f in ctx.fphrase: - if not isvar(f): - maxScore = 0.0 - for e in ctx.ephrase: - if not isvar(e): - b_e = ctx.online.bilex_e.get(e, 0) - if b_e: - maxScore = max(maxScore, ctx.online.bilex_fe.get(f, {}).get(e, 0) / b_e ) - maxOnScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE - return (maxOffScore + maxOnScore) / 2 + maxOffScore = 0.0 + for f in ctx.fphrase.words: + maxScore = max(ttable.get_score(f, e, 1) for e in ewords) + maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE + return maxOffScore return MaxLexFgivenE def IsSingletonF(ctx): @@ -140,8 +102,3 @@ def IsSupportedOnline(ctx): # Occurs in online data? return (ctx.online.paircount > 0.01) else: return False - -def CountExceptLM(vocab): - def CountExceptLM(ctx): # Word count in bitext (inc online data) but NOT mono text - return sum(1 for e in ctx.ephrase.words if e not in vocab) - return CountExceptLM diff --git a/python/cdec/sa/online.py b/python/cdec/sa/online.py index 92f6eae2..008793d8 100644 --- a/python/cdec/sa/online.py +++ b/python/cdec/sa/online.py @@ -26,28 +26,33 @@ def read_vocab(in_f): class Bilex: - def __init__(self, in_f=None, alignment_f=None, text_f=None, target_text_f=None): + def __init__(self, in_f=None): self.f = collections.defaultdict(int) self.e = collections.defaultdict(int) self.fe = collections.defaultdict(lambda: collections.defaultdict(int)) self.ef = collections.defaultdict(lambda: collections.defaultdict(int)) - - # Read from file if in_f: self.read(in_f) - # Build from aligned bitext - elif alignment_f: - # Allow one or two args for bitext - if target_text_f: - t = itertools.izip((line.strip() for line in gzip_or_text(text_f)), (line.strip() for line in gzip_or_text(target_text_f))) - else: - t = (line.strip().split(' ||| ') for line in gzip_or_text(text_f)) - a = (line.strip() for line in gzip_or_text(alignment_f)) - for (source, target) in t: - links = sorted(tuple(int(link) for link in link_str.split('-')) for link_str in a.next().split()) - self.update(source.split(), target.split(), links) - # Add bilex counts from new aligned sentence pair + def get_score(self, f, e, dir): + if dir == 0: + return self.p_fe(f, e) + if dir == 1: + return self.p_ef(e, f) + + def p_fe(self, f, e): + d = self.fe.get(f, None) + if not d: + return 0 + return d.get(e, 0) / self.f.get(f) + + def p_ef(self, e, f): + d = self.ef.get(e, None) + if not d: + return 0 + return d.get(f, 0) / self.e.get(e) + + # Update counts from aligned sentence def update(self, f_words, e_words, links): aligned_fe = [list() for _ in range(len(f_words))] aligned_ef = [list() for _ in range(len(e_words))] @@ -73,6 +78,18 @@ class Bilex: else: self.ef[e_words[e_i]][NULL_WORD] += 1 + # Update counts from alignd bitext + def add_bitext(self, alignment_f, text_f, target_text_f=None): + # Allow one or two args for bitext + if target_text_f: + t = itertools.izip((line.strip() for line in gzip_or_text(text_f)), (line.strip() for line in gzip_or_text(target_text_f))) + else: + t = (line.strip().split(' ||| ') for line in gzip_or_text(text_f)) + a = (line.strip() for line in gzip_or_text(alignment_f)) + for (source, target) in t: + links = sorted(tuple(int(link) for link in link_str.split('-')) for link_str in a.next().split()) + self.update(source.split(), target.split(), links) + def write(self, out_f): fv = sorted(self.f) ev = sorted(self.e) @@ -92,4 +109,27 @@ class Bilex: def read(self, in_f): with gzip_or_text(in_f) as inp: - pass + while True: + line = inp.readline().strip() + if not line: + break + (w, c) = line.split() + self.f[w] = int(c) + while True: + line = inp.readline().strip() + if not line: + break + (w, c) = line.split() + self.e[w] = int(c) + while True: + line = inp.readline().strip() + if not line: + break + (f, e, c) = line.split() + self.fe[f][e] = float(c) + while True: + line = inp.readline().strip() + if not line: + break + (e, f, c) = line.split() + self.ef[e][f] = float(c) diff --git a/python/cdec/sa/rulefactory.pxi b/python/cdec/sa/rulefactory.pxi index 86b994b9..ca3321a4 100644 --- a/python/cdec/sa/rulefactory.pxi +++ b/python/cdec/sa/rulefactory.pxi @@ -31,10 +31,6 @@ OnlineFeatureContext = namedtuple('OnlineFeatureContext', ['fcount', 'fsample_count', 'paircount', - 'bilex_f', - 'bilex_e', - 'bilex_fe', - 'bilex_ef' ]) cdef class OnlineStats: @@ -43,10 +39,6 @@ cdef class OnlineStats: cdef public phrases_e cdef public phrases_fe cdef public phrases_al - cdef public bilex_f - cdef public bilex_e - cdef public bilex_fe - cdef public bilex_ef def __cinit__(self): # Keep track of everything that can be sampled: @@ -58,12 +50,6 @@ cdef class OnlineStats: self.phrases_fe = defaultdict(lambda: defaultdict(int)) self.phrases_al = defaultdict(lambda: defaultdict(tuple)) - # Bilexical counts - self.bilex_f = defaultdict(int) - self.bilex_e = defaultdict(int) - self.bilex_fe = defaultdict(lambda: defaultdict(int)) - self.bilex_ef = defaultdict(lambda: defaultdict(int)) - cdef int PRECOMPUTE = 0 cdef int MERGE = 1 cdef int BAEZA_YATES = 2 @@ -2054,32 +2040,6 @@ cdef class HieroCachingRuleFactory: if not stats.phrases_al[f_ph][e_ph]: stats.phrases_al[f_ph][e_ph] = al - # Update Bilexical counts - aligned_fe = [list() for _ in range(len(f_words))] - aligned_ef = [list() for _ in range(len(e_words))] - null_word = sym_fromstring('NULL', True) - for (i, j) in alignment: - aligned_fe[i].append(j) - aligned_ef[j].append(i) - for f_i in range(len(f_words)): - stats.bilex_f[f_words[f_i]] += 1 - e_i_aligned = aligned_fe[f_i] - lc = len(e_i_aligned) - if lc > 0: - for e_i in e_i_aligned: - stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc - else: - stats.bilex_fe[f_words[f_i]][null_word] += 1 - for e_i in range(len(e_words)): - stats.bilex_e[e_words[e_i]] += 1 - f_i_aligned = aligned_ef[e_i] - lc = len(f_i_aligned) - if lc > 0: - for f_i in f_i_aligned: - stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc - else: - stats.bilex_ef[e_words[e_i]][null_word] += 1 - # Create a rule from source, target, non-terminals, and alignments def form_rule(self, f_i, e_i, f_span, e_span, nt, al): @@ -2159,7 +2119,7 @@ cdef class HieroCachingRuleFactory: fsample_count = stats.samples_f.get(f, 0) d = stats.phrases_fe.get(f, None) paircount = d.get(e, 0) if d else 0 - return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe) + return OnlineFeatureContext(fcount, fsample_count, paircount) return None # Find all phrases that we might try to extract -- cgit v1.2.3 From 3e9c683afd3a8440687abfd8be0b7a8ef252af8c Mon Sep 17 00:00:00 2001 From: Michael Denkowski Date: Fri, 7 Mar 2014 13:21:40 -0800 Subject: Unsmoothed bilex. Cython uses smoothing? --- python/cdec/sa/online.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'python/cdec/sa') diff --git a/python/cdec/sa/online.py b/python/cdec/sa/online.py index 008793d8..0783e727 100644 --- a/python/cdec/sa/online.py +++ b/python/cdec/sa/online.py @@ -36,9 +36,10 @@ class Bilex: def get_score(self, f, e, dir): if dir == 0: - return self.p_fe(f, e) - if dir == 1: - return self.p_ef(e, f) + p = self.p_fe(f, e) + elif dir == 1: + p = self.p_ef(e, f) + return p def p_fe(self, f, e): d = self.fe.get(f, None) @@ -60,22 +61,22 @@ class Bilex: aligned_fe[i].append(j) aligned_ef[j].append(i) for f_i in range(len(f_words)): - self.f[f_words[f_i]] += 1 e_i_aligned = aligned_fe[f_i] - lc = len(e_i_aligned) - if lc > 0: + if len(e_i_aligned) > 0: for e_i in e_i_aligned: - self.fe[f_words[f_i]][e_words[e_i]] += (1 / lc) + self.f[f_words[f_i]] += 1 + self.fe[f_words[f_i]][e_words[e_i]] += 1 else: + self.f[f_words[f_i]] += 1 self.fe[f_words[f_i]][NULL_WORD] += 1 for e_i in range(len(e_words)): - self.e[e_words[e_i]] += 1 f_i_aligned = aligned_ef[e_i] - lc = len(f_i_aligned) - if lc > 0: + if len(f_i_aligned) > 0: for f_i in f_i_aligned: - self.ef[e_words[e_i]][f_words[f_i]] += (1 / lc) + self.e[e_words[e_i]] += 1 + self.ef[e_words[e_i]][f_words[f_i]] += 1 else: + self.e[e_words[e_i]] += 1 self.ef[e_words[e_i]][NULL_WORD] += 1 # Update counts from alignd bitext @@ -103,9 +104,11 @@ class Bilex: for f in fv: for (e, c) in sorted(self.fe[f].iteritems()): out.write('{} {} {}\n'.format(f, e, c)) + out.write('\n') for e in ev: for (f, c) in sorted(self.ef[e].iteritems()): out.write('{} {} {}\n'.format(e, f, c)) + out.write('\n') def read(self, in_f): with gzip_or_text(in_f) as inp: -- cgit v1.2.3 From 82a9bf6824faf52d3a998a89db087e8dc022c252 Mon Sep 17 00:00:00 2001 From: mjdenkowski Date: Mon, 10 Mar 2014 18:17:06 -0400 Subject: Match Cython implementation subject to missing link issue --- python/cdec/sa/online.py | 58 ++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 26 deletions(-) (limited to 'python/cdec/sa') diff --git a/python/cdec/sa/online.py b/python/cdec/sa/online.py index 0783e727..f3054212 100644 --- a/python/cdec/sa/online.py +++ b/python/cdec/sa/online.py @@ -44,40 +44,46 @@ class Bilex: def p_fe(self, f, e): d = self.fe.get(f, None) if not d: - return 0 - return d.get(e, 0) / self.f.get(f) + return None + val = d.get(e, None) + if not val: + return None + return val / self.f.get(f) def p_ef(self, e, f): d = self.ef.get(e, None) if not d: - return 0 - return d.get(f, 0) / self.e.get(e) + return None + val = d.get(f, None) + if not val: + return None + return val / self.e.get(e) # Update counts from aligned sentence def update(self, f_words, e_words, links): - aligned_fe = [list() for _ in range(len(f_words))] - aligned_ef = [list() for _ in range(len(e_words))] + covered_f = set() + covered_e = set() for (i, j) in links: - aligned_fe[i].append(j) - aligned_ef[j].append(i) - for f_i in range(len(f_words)): - e_i_aligned = aligned_fe[f_i] - if len(e_i_aligned) > 0: - for e_i in e_i_aligned: - self.f[f_words[f_i]] += 1 - self.fe[f_words[f_i]][e_words[e_i]] += 1 - else: - self.f[f_words[f_i]] += 1 - self.fe[f_words[f_i]][NULL_WORD] += 1 - for e_i in range(len(e_words)): - f_i_aligned = aligned_ef[e_i] - if len(f_i_aligned) > 0: - for f_i in f_i_aligned: - self.e[e_words[e_i]] += 1 - self.ef[e_words[e_i]][f_words[f_i]] += 1 - else: - self.e[e_words[e_i]] += 1 - self.ef[e_words[e_i]][NULL_WORD] += 1 + covered_f.add(i) + covered_e.add(j) + self.f[f_words[i]] += 1 + self.e[e_words[j]] += 1 + self.fe[f_words[i]][e_words[j]] += 1 + self.ef[e_words[j]][f_words[i]] += 1 + # e being covered corresponds to f->e + for j in range(len(e_words)): + if j not in covered_e: + self.f[NULL_WORD] += 1 + self.e[e_words[j]] += 1 + self.fe[NULL_WORD][e_words[j]] += 1 + self.ef[e_words[j]][NULL_WORD] += 1 + # e->f + for i in range(len(f_words)): + if i not in covered_f: + self.f[f_words[i]] += 1 + self.e[NULL_WORD] += 1 + self.ef[NULL_WORD][f_words[i]] += 1 + self.fe[f_words[i]][NULL_WORD] += 1 # Update counts from alignd bitext def add_bitext(self, alignment_f, text_f, target_text_f=None): -- cgit v1.2.3 From 8c2d8217f068d8f107f95171496a25013d4e35fe Mon Sep 17 00:00:00 2001 From: mjdenkowski Date: Mon, 10 Mar 2014 18:32:53 -0400 Subject: Tuples are faster than bidirectional dicts --- python/cdec/sa/online.py | 56 +++++++++++++++++------------------------------- 1 file changed, 20 insertions(+), 36 deletions(-) (limited to 'python/cdec/sa') diff --git a/python/cdec/sa/online.py b/python/cdec/sa/online.py index f3054212..d3f967e8 100644 --- a/python/cdec/sa/online.py +++ b/python/cdec/sa/online.py @@ -29,11 +29,11 @@ class Bilex: def __init__(self, in_f=None): self.f = collections.defaultdict(int) self.e = collections.defaultdict(int) - self.fe = collections.defaultdict(lambda: collections.defaultdict(int)) - self.ef = collections.defaultdict(lambda: collections.defaultdict(int)) + self.fe = collections.defaultdict(int) if in_f: self.read(in_f) + # Compatibility with Cython implementation def get_score(self, f, e, dir): if dir == 0: p = self.p_fe(f, e) @@ -42,22 +42,22 @@ class Bilex: return p def p_fe(self, f, e): - d = self.fe.get(f, None) - if not d: + denom = self.f.get(f, None) + if not denom: return None - val = d.get(e, None) - if not val: + num = self.fe.get((f, e), None) + if not num: return None - return val / self.f.get(f) + return num / denom def p_ef(self, e, f): - d = self.ef.get(e, None) - if not d: + denom = self.e.get(e, None) + if not denom: return None - val = d.get(f, None) - if not val: + num = self.fe.get((f, e), None) + if not num: return None - return val / self.e.get(e) + return num / denom # Update counts from aligned sentence def update(self, f_words, e_words, links): @@ -68,22 +68,19 @@ class Bilex: covered_e.add(j) self.f[f_words[i]] += 1 self.e[e_words[j]] += 1 - self.fe[f_words[i]][e_words[j]] += 1 - self.ef[e_words[j]][f_words[i]] += 1 + self.fe[(f_words[i], e_words[j])] += 1 # e being covered corresponds to f->e for j in range(len(e_words)): if j not in covered_e: self.f[NULL_WORD] += 1 self.e[e_words[j]] += 1 - self.fe[NULL_WORD][e_words[j]] += 1 - self.ef[e_words[j]][NULL_WORD] += 1 + self.fe[(NULL_WORD, e_words[j])] += 1 # e->f for i in range(len(f_words)): if i not in covered_f: self.f[f_words[i]] += 1 self.e[NULL_WORD] += 1 - self.ef[NULL_WORD][f_words[i]] += 1 - self.fe[f_words[i]][NULL_WORD] += 1 + self.fe[(f_words[i], NULL_WORD)] += 1 # Update counts from alignd bitext def add_bitext(self, alignment_f, text_f, target_text_f=None): @@ -98,22 +95,15 @@ class Bilex: self.update(source.split(), target.split(), links) def write(self, out_f): - fv = sorted(self.f) - ev = sorted(self.e) with gzip.open(out_f, 'wb') as out: - for f in fv: + for f in sorted(self.f): out.write('{} {}\n'.format(f, self.f[f])) out.write('\n') - for e in ev: + for e in sorted(self.e): out.write('{} {}\n'.format(e, self.e[e])) out.write('\n') - for f in fv: - for (e, c) in sorted(self.fe[f].iteritems()): - out.write('{} {} {}\n'.format(f, e, c)) - out.write('\n') - for e in ev: - for (f, c) in sorted(self.ef[e].iteritems()): - out.write('{} {} {}\n'.format(e, f, c)) + for (f, e) in sorted(self.fe): + out.write('{} {} {}\n'.format(f, e, self.fe[(f, e)])) out.write('\n') def read(self, in_f): @@ -135,10 +125,4 @@ class Bilex: if not line: break (f, e, c) = line.split() - self.fe[f][e] = float(c) - while True: - line = inp.readline().strip() - if not line: - break - (e, f, c) = line.split() - self.ef[e][f] = float(c) + self.fe[(f, e)] = float(c) -- cgit v1.2.3 From 1197fb64e67b95ed497df4ebca5dd69e3e2db1b5 Mon Sep 17 00:00:00 2001 From: mjdenkowski Date: Tue, 11 Mar 2014 15:46:30 -0400 Subject: Update lexical weights in online grammar extraction --- python/cdec/sa/_sa.cpp | 43096 +++++++++++++++++++++------------------ python/cdec/sa/extractor.py | 27 +- python/cdec/sa/rulefactory.pxi | 14 +- 3 files changed, 22873 insertions(+), 20264 deletions(-) (limited to 'python/cdec/sa') diff --git a/python/cdec/sa/_sa.cpp b/python/cdec/sa/_sa.cpp index e19d519c..4c01ee79 100644 --- a/python/cdec/sa/_sa.cpp +++ b/python/cdec/sa/_sa.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.19.2 on Fri Mar 7 01:47:56 2014 */ +/* Generated by Cython 0.20.1 on Tue Mar 11 15:39:27 2014 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS @@ -19,6 +19,7 @@ #elif PY_VERSION_HEX < 0x02040000 #error Cython requires Python 2.4+. #else +#define CYTHON_ABI "0_20_1" #include /* For offsetof */ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -53,6 +54,9 @@ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX @@ -60,7 +64,7 @@ #define PY_FORMAT_SIZE_T "" #define CYTHON_FORMAT_SSIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(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), \ @@ -112,13 +116,15 @@ #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type #endif -#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 +#if PY_VERSION_HEX < 0x02060000 #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") #endif #if PY_MAJOR_VERSION >= 3 @@ -131,19 +137,44 @@ #if PY_VERSION_HEX < 0x02060000 #define Py_TPFLAGS_HAVE_VERSION_TAG 0 #endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #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_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #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])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type @@ -176,7 +207,7 @@ #else #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if PY_VERSION_HEX < 0x02060000 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) @@ -201,11 +232,12 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif -#if PY_VERSION_HEX < 0x03020000 +#if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong @@ -342,8 +374,20 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); @@ -354,9 +398,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) #if PY_MAJOR_VERSION < 3 @@ -378,7 +424,6 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); 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 @@ -387,7 +432,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params() { +static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys = NULL; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; @@ -412,7 +457,7 @@ static int __Pyx_init_sys_getdefaultencoding_params() { if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.", + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } @@ -436,7 +481,7 @@ bad: #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params() { +static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys = NULL; PyObject* default_encoding = NULL; char* default_encoding_c; @@ -503,62 +548,62 @@ static const char *__pyx_f[] = { }; /*--- Type declarations ---*/ +struct __pyx_obj_4cdec_2sa_3_sa_FloatList; +struct __pyx_obj_4cdec_2sa_3_sa_IntList; struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector; -struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule; +struct __pyx_obj_4cdec_2sa_3_sa_Phrase; +struct __pyx_obj_4cdec_2sa_3_sa_Rule; +struct __pyx_obj_4cdec_2sa_3_sa_StringMap; +struct __pyx_obj_4cdec_2sa_3_sa_DataArray; +struct __pyx_obj_4cdec_2sa_3_sa_Alignment; +struct __pyx_obj_4cdec_2sa_3_sa_BiLex; +struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator; +struct __pyx_obj_4cdec_2sa_3_sa_BitSet; +struct __pyx_obj_4cdec_2sa_3_sa_VEBIterator; +struct __pyx_obj_4cdec_2sa_3_sa_VEB; struct __pyx_obj_4cdec_2sa_3_sa_LCP; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa_Alphabet; +struct __pyx_obj_4cdec_2sa_3_sa_TrieMap; +struct __pyx_obj_4cdec_2sa_3_sa_Precomputation; +struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray; struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats; -struct __pyx_obj_4cdec_2sa_3_sa_IntList; -struct __pyx_obj_4cdec_2sa_3_sa_Phrase; struct __pyx_obj_4cdec_2sa_3_sa_TrieNode; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases; struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode; -struct __pyx_obj_4cdec_2sa_3_sa_Alignment; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr; -struct __pyx_obj_4cdec_2sa_3_sa_Rule; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr; -struct __pyx_obj_4cdec_2sa_3_sa_Precomputation; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance; -struct __pyx_obj_4cdec_2sa_3_sa_TrieMap; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments; -struct __pyx_obj_4cdec_2sa_3_sa_VEBIterator; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr; -struct __pyx_obj_4cdec_2sa_3_sa_FloatList; -struct __pyx_obj_4cdec_2sa_3_sa_StringMap; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__; struct __pyx_obj_4cdec_2sa_3_sa_TrieTable; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr; -struct __pyx_obj_4cdec_2sa_3_sa_VEB; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice; struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation; -struct __pyx_obj_4cdec_2sa_3_sa_Scorer; struct __pyx_obj_4cdec_2sa_3_sa_Sampler; -struct __pyx_obj_4cdec_2sa_3_sa_Alphabet; -struct __pyx_obj_4cdec_2sa_3_sa_BiLex; -struct __pyx_obj_4cdec_2sa_3_sa_DataArray; -struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator; struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats; -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa_Scorer; struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice; struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr; -struct __pyx_obj_4cdec_2sa_3_sa_BitSet; struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__; +struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr; struct __pyx_t_4cdec_2sa_3_sa__node; struct __pyx_t_4cdec_2sa_3_sa__BitSet; struct __pyx_t_4cdec_2sa_3_sa__VEB; @@ -567,7 +612,7 @@ struct __pyx_t_4cdec_2sa_3_sa__Trie_Node; struct __pyx_t_4cdec_2sa_3_sa_match_node; struct __pyx_t_4cdec_2sa_3_sa_Matching; -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":9 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":9 * from libc.string cimport memset, strcpy * * cdef struct _node: # <<<<<<<<<<<<<< @@ -581,7 +626,7 @@ struct __pyx_t_4cdec_2sa_3_sa__node { int val; }; -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":30 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":30 * _init_lower_mask() * * cdef struct _BitSet: # <<<<<<<<<<<<<< @@ -595,7 +640,7 @@ struct __pyx_t_4cdec_2sa_3_sa__BitSet { int size; }; -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":168 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":168 * return result * * cdef struct _VEB: # <<<<<<<<<<<<<< @@ -612,7 +657,7 @@ struct __pyx_t_4cdec_2sa_3_sa__VEB { void **bottom; }; -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":10 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":10 * cdef struct _Trie_Node # forward decl * * cdef struct _Trie_Edge: # <<<<<<<<<<<<<< @@ -626,7 +671,7 @@ struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge { struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *smaller; }; -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":8 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":8 * from libc.string cimport memset, memcpy * * cdef struct _Trie_Node # forward decl # <<<<<<<<<<<<<< @@ -639,7 +684,7 @@ struct __pyx_t_4cdec_2sa_3_sa__Trie_Node { int arr_len; }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":90 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":90 * * # linked list structure for storing matches in BaselineRuleFactory * cdef struct match_node: # <<<<<<<<<<<<<< @@ -651,7 +696,7 @@ struct __pyx_t_4cdec_2sa_3_sa_match_node { struct __pyx_t_4cdec_2sa_3_sa_match_node *next; }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":186 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":186 * * # struct used to encapsulate a single matching * cdef struct Matching: # <<<<<<<<<<<<<< @@ -666,6 +711,40 @@ struct __pyx_t_4cdec_2sa_3_sa_Matching { int size; }; +/* "cdec/sa/_sa.pxd":3 + * from libc.stdio cimport FILE + * + * cdef class FloatList: # <<<<<<<<<<<<<< + * cdef int size + * cdef int increment + */ +struct __pyx_obj_4cdec_2sa_3_sa_FloatList { + PyObject_HEAD + struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *__pyx_vtab; + int size; + int increment; + int len; + float *arr; +}; + + +/* "cdec/sa/_sa.pxd":12 + * cdef void read_handle(self, FILE* f) + * + * cdef class IntList: # <<<<<<<<<<<<<< + * cdef int size + * cdef int increment + */ +struct __pyx_obj_4cdec_2sa_3_sa_IntList { + PyObject_HEAD + struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *__pyx_vtab; + int size; + int increment; + int len; + int *arr; +}; + + /* "cdec/sa/_sa.pxd":25 * cdef void read_handle(self, FILE* f) * @@ -680,211 +759,280 @@ struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector { }; -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":6 - * from libc.stdio cimport FILE, fclose, fopen +/* "cdec/sa/_sa.pxd":29 + * cdef FloatList values * - * cdef class SuffixArray: # <<<<<<<<<<<<<< - * cdef DataArray darray - * cdef IntList sa + * cdef class Phrase: # <<<<<<<<<<<<<< + * cdef int *syms + * cdef int n, *varpos, n_vars */ -struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray { +struct __pyx_obj_4cdec_2sa_3_sa_Phrase { PyObject_HEAD - struct __pyx_vtabstruct_4cdec_2sa_3_sa_SuffixArray *__pyx_vtab; - struct __pyx_obj_4cdec_2sa_3_sa_DataArray *darray; - struct __pyx_obj_4cdec_2sa_3_sa_IntList *sa; - struct __pyx_obj_4cdec_2sa_3_sa_IntList *ha; + struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *__pyx_vtab; + int *syms; + int n; + int *varpos; + int n_vars; }; -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":110 - * return sym_isvar(sym) +/* "cdec/sa/_sa.pxd":35 + * cdef public int chunklen(self, int k) * - * def make_lattice(words): # <<<<<<<<<<<<<< - * word_ids = (sym_fromstring(word, True) for word in words) - * return tuple(((word, None, 1), ) for word in word_ids) + * cdef class Rule: # <<<<<<<<<<<<<< + * cdef int lhs + * cdef readonly Phrase f, e */ -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice { +struct __pyx_obj_4cdec_2sa_3_sa_Rule { PyObject_HEAD - PyObject *__pyx_v_word_ids; - PyObject *__pyx_v_words; + int lhs; + struct __pyx_obj_4cdec_2sa_3_sa_Phrase *f; + struct __pyx_obj_4cdec_2sa_3_sa_Phrase *e; + struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *scores; + int n_scores; + PyObject *word_alignments; }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2109 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":8 + * char* stringmap_word(StrMap *vocab, int i) * - * # Rule string from rule - * def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<< - * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) - * return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) + * cdef class StringMap: # <<<<<<<<<<<<<< + * cdef StrMap *vocab + * cdef char *word(self, int i) */ -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule { +struct __pyx_obj_4cdec_2sa_3_sa_StringMap { PyObject_HEAD - PyObject *__pyx_v_a; - struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self; + struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *__pyx_vtab; + StrMap *vocab; }; -/* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":5 - * as k most frequent n-grams""" +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":9 + * from libc.string cimport memset, strcpy * - * cdef class LCP: # <<<<<<<<<<<<<< - * cdef SuffixArray sa - * cdef IntList lcp + * cdef class DataArray: # <<<<<<<<<<<<<< + * cdef public word2id + * cdef public id2word */ -struct __pyx_obj_4cdec_2sa_3_sa_LCP { +struct __pyx_obj_4cdec_2sa_3_sa_DataArray { PyObject_HEAD - struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *sa; - struct __pyx_obj_4cdec_2sa_3_sa_IntList *lcp; + struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray *__pyx_vtab; + PyObject *word2id; + PyObject *id2word; + struct __pyx_obj_4cdec_2sa_3_sa_IntList *data; + struct __pyx_obj_4cdec_2sa_3_sa_IntList *sent_id; + struct __pyx_obj_4cdec_2sa_3_sa_IntList *sent_index; + int use_sent_id; }; -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":186 - * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] - * if self.word_alignments is not None: - * fields.append(' '.join('%d-%d' % a for a in self.alignments())) # <<<<<<<<<<<<<< - * return ' ||| '.join(fields) +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":10 + * cdef int ALIGNMENT_CODE = 1 << 16 * + * cdef class Alignment: # <<<<<<<<<<<<<< + * cdef IntList links + * cdef IntList sent_index */ -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr { +struct __pyx_obj_4cdec_2sa_3_sa_Alignment { PyObject_HEAD - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *__pyx_outer_scope; - PyObject *__pyx_v_a; - PyObject *__pyx_t_0; - Py_ssize_t __pyx_t_1; - PyObject *(*__pyx_t_2)(PyObject *); + struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *__pyx_vtab; + struct __pyx_obj_4cdec_2sa_3_sa_IntList *links; + struct __pyx_obj_4cdec_2sa_3_sa_IntList *sent_index; }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":36 - * ]) +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":47 * - * cdef class OnlineStats: # <<<<<<<<<<<<<< - * cdef public samples_f - * cdef public phrases_f + * + * cdef class BiLex: # <<<<<<<<<<<<<< + * cdef FloatList col1 + * cdef FloatList col2 */ -struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats { +struct __pyx_obj_4cdec_2sa_3_sa_BiLex { PyObject_HEAD - PyObject *samples_f; - PyObject *phrases_f; - PyObject *phrases_e; - PyObject *phrases_fe; - PyObject *phrases_al; + struct __pyx_vtabstruct_4cdec_2sa_3_sa_BiLex *__pyx_vtab; + struct __pyx_obj_4cdec_2sa_3_sa_FloatList *col1; + struct __pyx_obj_4cdec_2sa_3_sa_FloatList *col2; + struct __pyx_obj_4cdec_2sa_3_sa_IntList *f_index; + struct __pyx_obj_4cdec_2sa_3_sa_IntList *e_index; + PyObject *id2eword; + PyObject *id2fword; + PyObject *eword2id; + PyObject *fword2id; }; -/* "cdec/sa/_sa.pxd":12 - * cdef void read_handle(self, FILE* f) +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":100 * - * cdef class IntList: # <<<<<<<<<<<<<< - * cdef int size - * cdef int increment + * + * cdef class BitSetIterator: # <<<<<<<<<<<<<< + * cdef _BitSet* b + * cdef int next_val */ -struct __pyx_obj_4cdec_2sa_3_sa_IntList { +struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator { PyObject_HEAD - struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *__pyx_vtab; - int size; - int increment; - int len; - int *arr; + struct __pyx_t_4cdec_2sa_3_sa__BitSet *b; + int next_val; }; -/* "cdec/sa/_sa.pxd":29 - * cdef FloatList values +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":118 + * # (entirely C-implemented) _BitSet struct. + * # Very slow; use only for debugging + * cdef class BitSet: # <<<<<<<<<<<<<< * - * cdef class Phrase: # <<<<<<<<<<<<<< - * cdef int *syms - * cdef int n, *varpos, n_vars + * cdef _BitSet* b */ -struct __pyx_obj_4cdec_2sa_3_sa_Phrase { +struct __pyx_obj_4cdec_2sa_3_sa_BitSet { PyObject_HEAD - struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *__pyx_vtab; - int *syms; - int n; - int *varpos; - int n_vars; + struct __pyx_t_4cdec_2sa_3_sa__BitSet *b; }; -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":60 - * cdef int EPSILON = sym_fromstring('*EPS*', True) +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":340 * - * cdef class TrieNode: # <<<<<<<<<<<<<< - * cdef public children * + * cdef class VEBIterator: # <<<<<<<<<<<<<< + * cdef _VEB* v + * cdef int next_val */ -struct __pyx_obj_4cdec_2sa_3_sa_TrieNode { +struct __pyx_obj_4cdec_2sa_3_sa_VEBIterator { PyObject_HEAD - PyObject *children; + struct __pyx_t_4cdec_2sa_3_sa__VEB *v; + int next_val; }; -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":74 - * def read_bitext(self, char* filename, int side): - * with gzip_or_text(filename) as fp: - * data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<< - * self.read_text_data(data) +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":354 + * * + * cdef class VEB: # <<<<<<<<<<<<<< + * cdef _VEB* veb + * cdef int _findsucc(self, int i) */ -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr { +struct __pyx_obj_4cdec_2sa_3_sa_VEB { PyObject_HEAD - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *__pyx_outer_scope; - PyObject *__pyx_v_line; - PyObject *__pyx_t_0; - Py_ssize_t __pyx_t_1; - PyObject *(*__pyx_t_2)(PyObject *); + struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB *__pyx_vtab; + struct __pyx_t_4cdec_2sa_3_sa__VEB *veb; }; -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":72 - * self.read_text_data(fp) +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":5 + * as k most frequent n-grams""" * - * def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<< - * with gzip_or_text(filename) as fp: - * data = (line.split(' ||| ')[side] for line in fp) + * cdef class LCP: # <<<<<<<<<<<<<< + * cdef SuffixArray sa + * cdef IntList lcp */ -struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext { +struct __pyx_obj_4cdec_2sa_3_sa_LCP { PyObject_HEAD - PyObject *__pyx_v_fp; - int __pyx_v_side; + struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *sa; + struct __pyx_obj_4cdec_2sa_3_sa_IntList *lcp; }; -/* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":21 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":7 + * cdef int INDEX_MASK = (1< + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; @@ -2134,20 +2207,21 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif -#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); @@ -2164,7 +2238,7 @@ static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_ if (unlikely(!args)) return NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; - result = PyObject_Call(method, args, NULL); + result = __Pyx_PyObject_Call(method, args, NULL); Py_DECREF(method); bad: Py_DECREF(args); @@ -2179,7 +2253,35 @@ bad: #define __Pyx_PyObject_CallMethod0(obj, name) \ __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) -static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX >= 0x03020000 || PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000) +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ @@ -2208,10 +2310,11 @@ static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ -#define __Pyx_SetItemInt(o, i, v, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_SetItemInt_Fast(o, i, v, is_list, wraparound, boundscheck) : \ - __Pyx_SetItemInt_Generic(o, to_py_func(i), v)) +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \ + __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); @@ -2232,7 +2335,7 @@ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); /*proto*/ #if CYTHON_COMPILING_IN_CPYTHON @@ -2256,6 +2359,43 @@ static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, i return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/ +#endif + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ @@ -2282,19 +2422,19 @@ static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t #define PySet_Contains(anyset, key) \ PySequence_Contains((anyset), (key)) #define PySet_Pop(set) \ - PyObject_CallMethod(set, (char *)"pop", NULL) + PyObject_CallMethod((set), (char*)"pop", NULL) static CYTHON_INLINE int PySet_Clear(PyObject *set) { - PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL); + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); if (!ret) return -1; Py_DECREF(ret); return 0; } static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { - PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key); + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); if (!ret) return -1; Py_DECREF(ret); return 0; } static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { - PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key); + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); if (!ret) return -1; Py_DECREF(ret); return 0; } @@ -2303,25 +2443,7 @@ static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */ -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #define __Pyx_CyFunction_USED 1 #include @@ -2338,28 +2460,30 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; - int flags; PyObject *func_dict; PyObject *func_weakreflist; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; + PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; /* No-args super() class cell */ void *defaults; int defaults_pyobjects; + int flags; PyObject *defaults_tuple; /* Const defaults tuple */ PyObject *defaults_kwdict; /* Const kwonly defaults dict */ PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; /* function annotations dict */ } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; -#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, code) \ - __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, code) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *self, PyObject *module, + PyObject *self, + PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, @@ -2372,50 +2496,45 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __Pyx_CyFunction_init(void); -static CYTHON_INLINE PyObject* __Pyx_PyObject_Pop(PyObject* L); /*proto*/ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +#define __Pyx_PyObject_Pop(L) (PyList_CheckExact(L) ? \ + __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) +static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); /*proto*/ +static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); /*proto*/ -#include +#define __Pyx_PyObject_PopIndex(L, ix) (PyList_CheckExact(L) ? \ + __Pyx_PyList_PopIndex(L, ix) : __Pyx__PyObject_PopIndex(L, ix)) +static PyObject* __Pyx_PyList_PopIndex(PyObject* L, Py_ssize_t ix); /*proto*/ +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, Py_ssize_t ix); /*proto*/ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ @@ -2434,7 +2553,7 @@ typedef struct { PyObject *classobj; PyObject *yieldfrom; int resume_label; - char is_running; // using T_BOOL for property below requires char value + char is_running; } __pyx_GeneratorObject; static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, PyObject *closure); @@ -2479,62 +2598,62 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ /* Module declarations from 'libc.math' */ /* Module declarations from 'cdec.sa._sa' */ +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_FloatList = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_IntList = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_FeatureVector = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_SuffixArray = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Phrase = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Rule = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_StringMap = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_DataArray = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Alignment = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_BiLex = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_BitSetIterator = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_BitSet = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_VEBIterator = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_VEB = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_LCP = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Alphabet = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_TrieMap = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Precomputation = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_SuffixArray = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_OnlineStats = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_IntList = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Phrase = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_TrieNode = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Alignment = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_input = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Rule = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Precomputation = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_TrieMap = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_VEBIterator = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_FloatList = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_StringMap = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_TrieTable = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_VEB = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Scorer = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Sampler = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Alphabet = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_BiLex = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_DataArray = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_BitSetIterator = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_HieroCachingRuleFactory = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_Scorer = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct____iter__ = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr = 0; -static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_BitSet = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_input = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = 0; +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = 0; static int __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE; static int __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE; static int __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS; @@ -2806,7 +2925,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_4c static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4cdec_2sa_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_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_Sampler *__pyx_v_self, int __pyx_v_sample_size, struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_fsarray); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec_2sa_3_sa_Sampler *__pyx_v_self, struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_v_phrase_location); /* proto */ -static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_4cdec_2sa_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 int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_alignment, PyObject *__pyx_v_bilex, 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_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_fsarray, struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_edarray, struct __pyx_obj_4cdec_2sa_3_sa_Sampler *__pyx_v_sampler, struct __pyx_obj_4cdec_2sa_3_sa_Scorer *__pyx_v_scorer); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern); /* proto */ @@ -2843,869 +2962,887 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_4__iter__(struct __pyx_ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str___genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_v_self); /* proto */ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3_sa_Scorer *__pyx_v_self, PyObject *__pyx_v_models); /* proto */ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_FloatList(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_IntList(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_FeatureVector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_SuffixArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Phrase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Rule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_StringMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_DataArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Alignment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BiLex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BitSetIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BitSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_VEBIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_VEB(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_LCP(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Alphabet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_TrieMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Precomputation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_SuffixArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_OnlineStats(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_IntList(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Phrase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_TrieNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_ExtendedTrieNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Alignment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Rule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Precomputation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_TrieMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_VEBIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_FloatList(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_StringMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_TrieTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_VEB(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_PhraseLocation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Scorer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Sampler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Alphabet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BiLex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_DataArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BitSetIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_HieroCachingRuleFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Scorer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BitSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence(PyTypeObject *t, PyObject *a, PyObject *k); /*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["; -static char __pyx_k_4[] = ","; -static char __pyx_k_5[] = "]"; -static char __pyx_k_6[] = "len="; -static char __pyx_k_7[] = "%s not in IntList"; -static char __pyx_k_8[] = "Requested index %d of %d-length IntList"; -static char __pyx_k_9[] = "Requested index %d:%d of %d-length IntList"; -static char __pyx_k_10[] = "Illegal key type %s for IntList"; -static char __pyx_k_14[] = "%s "; -static char __pyx_k_15[] = "\n"; -static char __pyx_k_19[] = " ||| "; -static char __pyx_k_23[] = "%d "; -static char __pyx_k_27[] = "%s %d "; -static char __pyx_k_29[] = "write_enhanced_handle"; -static char __pyx_k_33[] = "-"; -static char __pyx_k_37[] = "%d-%d "; -static char __pyx_k_44[] = "%d-%d out of bounds (I=%d,J=%d) in line %d\n"; -static char __pyx_k_47[] = ""; -static char __pyx_k_48[] = "Sort error in CLex"; -static char __pyx_k_50[] = " "; -static char __pyx_k_52[] = "%d %f %f "; -static char __pyx_k_54[] = "%d %s "; -static char __pyx_k_58[] = "%s %s %.6f %.6f\n"; -static char __pyx_k_60[] = " ("; -static char __pyx_k_61[] = ")"; -static char __pyx_k_62[] = "Constructing LCP array"; -static char __pyx_k_64[] = "LCP array completed"; -static char __pyx_k_66[] = "[%s,%d]"; -static char __pyx_k_67[] = "[%s]"; -static char __pyx_k_68[] = "\\"; -static char __pyx_k_69[] = " "; -static char __pyx_k_70[] = "Invalid LHS symbol: %d"; -static char __pyx_k_71[] = "%d-%d"; -static char __pyx_k_72[] = "precompute_secondary_rank"; -static char __pyx_k_73[] = "train_max_initial_size"; -static char __pyx_k_74[] = "Precomputing frequent intersections"; -static char __pyx_k_76[] = " Computing inverted indexes..."; -static char __pyx_k_78[] = " Computing collocations..."; -static char __pyx_k_80[] = " %d sentences"; -static char __pyx_k_85[] = "X "; -static char __pyx_k_86[] = "ERROR: unexpected pattern %s in set of precomputed collocations"; -static char __pyx_k_87[] = "RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d"; -static char __pyx_k_88[] = "Precomputed collocations for %d patterns out of %d possible (upper bound %d)"; -static char __pyx_k_89[] = "Precomputed inverted index for %d patterns "; -static char __pyx_k_90[] = "Precomputation took %f seconds"; -static char __pyx_k_91[] = " Bucket sort took %f seconds"; -static char __pyx_k_92[] = " Refining, sort depth = %d"; -static char __pyx_k_93[] = " Refinement took %f seconds"; -static char __pyx_k_94[] = " Finalizing sort..."; -static char __pyx_k_96[] = "Suffix array construction took %f seconds"; -static char __pyx_k_97[] = "Unexpected condition found in q3sort: sort from %d to %d"; -static char __pyx_k__0[] = "0"; -static char __pyx_k__1[] = "1"; -static char __pyx_k__a[] = "a"; -static char __pyx_k__e[] = "e"; -static char __pyx_k__f[] = "f"; -static char __pyx_k__h[] = "h"; -static char __pyx_k__i[] = "i"; -static char __pyx_k__j[] = "j"; -static char __pyx_k__k[] = "k"; -static char __pyx_k__r[] = "r"; -static char __pyx_k__w[] = "w"; -static char __pyx_k__x[] = "x"; -static char __pyx_k__y[] = "y"; -static char __pyx_k_101[] = "OnlineStats.__cinit__.."; -static char __pyx_k_102[] = "cdec.sa._sa"; -static char __pyx_k_104[] = "Sampling strategy: uniform, max sample size = %d"; -static char __pyx_k_105[] = "Sampling strategy: no sampling"; -static char __pyx_k_107[] = "require_aligned_terminal"; -static char __pyx_k_108[] = "require_aligned_chunks"; -static char __pyx_k_109[] = "[X]"; -static char __pyx_k_110[] = "Must specify an alignment object"; -static char __pyx_k_112[] = "Reading precomputed data from file %s... "; -static char __pyx_k_113[] = "Precomputation done with max nonterminals %d, decoder uses %d"; -static char __pyx_k_114[] = "Precomputation done with max terminals %d, decoder uses %d"; -static char __pyx_k_115[] = "Precomputation done with max initial size %d, decoder uses %d"; -static char __pyx_k_116[] = "Precomputation done with min gap size %d, decoder uses %d"; -static char __pyx_k_117[] = "Converting %d hash keys on precomputed inverted index... "; -static char __pyx_k_118[] = "Converting %d hash keys on precomputed collocations... "; -static char __pyx_k_119[] = "Processing precomputations took %f seconds"; -static char __pyx_k_120[] = "{"; - static char __pyx_k_121[] = "("; -static char __pyx_k_122[] = "}"; -static char __pyx_k_123[] = "get_precomputed_collocation"; -static char __pyx_k_124[] = "double binary"; -static char __pyx_k_125[] = "HieroCachingRuleFactory.input..lambda3.."; -static char __pyx_k_126[] = "Keyword trie error"; -static char __pyx_k_128[] = "HieroCachingRuleFactory.input.."; -static char __pyx_k_129[] = "get_all_nodes_isteps_away"; -static char __pyx_k_130[] = "Total time for rule lookup, extraction, and scoring = %f seconds"; -static char __pyx_k_131[] = " Extract time = %f seconds"; -static char __pyx_k_132[] = " Intersect time = %f seconds"; -static char __pyx_k_133[] = "No aligned terminals"; -static char __pyx_k_134[] = "Unaligned chunk"; -static char __pyx_k_135[] = "Gaps are not tight phrases"; -static char __pyx_k_136[] = "Inside edges of preceding subphrase are not tight"; -static char __pyx_k_137[] = "Inside edges of following subphrase are not tight"; -static char __pyx_k_138[] = "Subphrase [%d, %d] failed integrity check"; -static char __pyx_k_139[] = "Didn't extract anything from [%d, %d] -> [%d, %d]"; -static char __pyx_k_140[] = "Unable to extract basic phrase"; -static char __pyx_k_144[] = "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi"; -static char __pyx_k_145[] = "HieroCachingRuleFactory.add_instance..extract"; -static char __pyx_k_147[] = "HieroCachingRuleFactory.form_rule.."; -static char __pyx_k_150[] = "{0}-{1}"; -static char __pyx_k_151[] = "[X] ||| {0} ||| {1} ||| {2}"; -static char __pyx_k_152[] = "OnlineFeatureContext"; -static char __pyx_k_155[] = "HieroCachingRuleFactory.get_f_phrases..extract"; -static char __pyx_k_156[] = "%s=%s"; -static char __pyx_k_158[] = "/home/mdenkows/cdec/python/cdec/sa/_sa.pyx"; -static char __pyx_k_161[] = "cdec.sa"; -static char __pyx_k_165[] = "/home/mdenkows/cdec/python/cdec/sa/sym.pxi"; -static char __pyx_k_176[] = "*EPS*"; -static char __pyx_k__al[] = "al"; -static char __pyx_k__gc[] = "gc"; -static char __pyx_k__nt[] = "nt"; -static char __pyx_k__sa[] = "sa"; -static char __pyx_k__wc[] = "wc"; -static char __pyx_k__arr[] = "arr"; -static char __pyx_k__cmp[] = "cmp"; -static char __pyx_k__col[] = "col"; -static char __pyx_k__e_i[] = "e_i"; -static char __pyx_k__e_j[] = "e_j"; -static char __pyx_k__end[] = "end"; -static char __pyx_k__f_i[] = "f_i"; -static char __pyx_k__f_j[] = "f_j"; -static char __pyx_k__get[] = "get"; -static char __pyx_k__isa[] = "isa"; -static char __pyx_k__ito[] = "ito"; -static char __pyx_k__key[] = "key"; -static char __pyx_k__lhs[] = "lhs"; -static char __pyx_k__low[] = "low"; -static char __pyx_k__map[] = "map"; -static char __pyx_k__max[] = "max"; -static char __pyx_k__ntc[] = "ntc"; -static char __pyx_k__pad[] = "pad"; -static char __pyx_k__pop[] = "pop"; -static char __pyx_k__res[] = "res"; -static char __pyx_k__set[] = "set"; -static char __pyx_k__sym[] = "sym"; -static char __pyx_k__vec[] = "vec"; -static char __pyx_k__zip[] = "zip"; -static char __pyx_k__NULL[] = "NULL"; -static char __pyx_k__args[] = "args"; -static char __pyx_k__dist[] = "dist"; -static char __pyx_k__gzip[] = "gzip"; -static char __pyx_k__high[] = "high"; -static char __pyx_k__info[] = "info"; -static char __pyx_k__join[] = "join"; -static char __pyx_k__link[] = "link"; -static char __pyx_k__meta[] = "meta"; -static char __pyx_k__name[] = "name"; -static char __pyx_k__open[] = "open"; -static char __pyx_k__seek[] = "seek"; -static char __pyx_k__send[] = "send"; -static char __pyx_k__side[] = "side"; -static char __pyx_k__size[] = "size"; -static char __pyx_k__skip[] = "skip"; -static char __pyx_k__stop[] = "stop"; -static char __pyx_k__syms[] = "syms"; -static char __pyx_k__warn[] = "warn"; -static char __pyx_k__word[] = "word"; -static char __pyx_k___SEP_[] = "_SEP_"; -static char __pyx_k__arity[] = "arity"; -static char __pyx_k__chain[] = "chain"; -static char __pyx_k__close[] = "close"; -static char __pyx_k__debug[] = "debug"; -static char __pyx_k__eword[] = "eword"; -static char __pyx_k__fword[] = "fword"; -static char __pyx_k__ifrom[] = "ifrom"; -static char __pyx_k__index[] = "index"; -static char __pyx_k__isvar[] = "isvar"; -static char __pyx_k__lex_i[] = "lex_i"; -static char __pyx_k__lex_j[] = "lex_j"; -static char __pyx_k__links[] = "links"; -static char __pyx_k__merge[] = "merge"; -static char __pyx_k__range[] = "range"; -static char __pyx_k__reset[] = "reset"; -static char __pyx_k__split[] = "split"; -static char __pyx_k__start[] = "start"; -static char __pyx_k__stats[] = "stats"; -static char __pyx_k__throw[] = "throw"; -static char __pyx_k__toMap[] = "toMap"; -static char __pyx_k__value[] = "value"; -static char __pyx_k__words[] = "words"; -static char __pyx_k__write[] = "write"; -static char __pyx_k__append[] = "append"; -static char __pyx_k__e_span[] = "e_span"; -static char __pyx_k__e_text[] = "e_text"; -static char __pyx_k__earray[] = "earray"; -static char __pyx_k__extend[] = "extend"; -static char __pyx_k__f_span[] = "f_span"; -static char __pyx_k__f_text[] = "f_text"; -static char __pyx_k__fcount[] = "fcount"; -static char __pyx_k__format[] = "format"; -static char __pyx_k__fwords[] = "fwords"; -static char __pyx_k__get_id[] = "get_id"; -static char __pyx_k__insert[] = "insert"; -static char __pyx_k__link_i[] = "link_i"; -static char __pyx_k__link_j[] = "link_j"; -static char __pyx_k__logger[] = "logger"; -static char __pyx_k__lookup[] = "lookup"; -static char __pyx_k__offset[] = "offset"; -static char __pyx_k__online[] = "online"; -static char __pyx_k__phrase[] = "phrase"; -static char __pyx_k__q3sort[] = "q3sort"; -static char __pyx_k__sa_low[] = "sa_low"; -static char __pyx_k__sample[] = "sample"; -static char __pyx_k__sarray[] = "sarray"; -static char __pyx_k__scorer[] = "scorer"; -static char __pyx_k__scores[] = "scores"; -static char __pyx_k__sorted[] = "sorted"; -static char __pyx_k__source[] = "source"; -static char __pyx_k__unlink[] = "unlink"; -static char __pyx_k__Counter[] = "Counter"; -static char __pyx_k__advance[] = "advance"; -static char __pyx_k__arr_low[] = "arr_low"; -static char __pyx_k__collect[] = "collect"; -static char __pyx_k__e_words[] = "e_words"; -static char __pyx_k__edarray[] = "edarray"; -static char __pyx_k__ephrase[] = "ephrase"; -static char __pyx_k__extract[] = "extract"; -static char __pyx_k__f_words[] = "f_words"; -static char __pyx_k__fphrase[] = "fphrase"; -static char __pyx_k__fsarray[] = "fsarray"; -static char __pyx_k__genexpr[] = "genexpr"; -static char __pyx_k__lattice[] = "lattice"; -static char __pyx_k__logging[] = "logging"; -static char __pyx_k__matches[] = "matches"; -static char __pyx_k__new_e_i[] = "new_e_i"; -static char __pyx_k__new_e_j[] = "new_e_j"; -static char __pyx_k__nt_open[] = "nt_open"; -static char __pyx_k__pathlen[] = "pathlen"; -static char __pyx_k__sa_high[] = "sa_high"; -static char __pyx_k__sampler[] = "sampler"; -static char __pyx_k__spanlen[] = "spanlen"; -static char __pyx_k__GzipFile[] = "GzipFile"; -static char __pyx_k____exit__[] = "__exit__"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____name__[] = "__name__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k___columns[] = "_columns"; -static char __pyx_k__arr_high[] = "arr_high"; -static char __pyx_k__category[] = "category"; -static char __pyx_k__children[] = "children"; -static char __pyx_k__ctx_name[] = "ctx_name"; -static char __pyx_k__curr_idx[] = "curr_idx"; -static char __pyx_k__extended[] = "extended"; -static char __pyx_k__filename[] = "filename"; -static char __pyx_k__frontier[] = "frontier"; -static char __pyx_k__get_e_id[] = "get_e_id"; -static char __pyx_k__get_f_id[] = "get_f_id"; -static char __pyx_k__get_word[] = "get_word"; -static char __pyx_k__getchunk[] = "getchunk"; -static char __pyx_k__min_dist[] = "min_dist"; -static char __pyx_k__resource[] = "resource"; -static char __pyx_k__ru_stime[] = "ru_stime"; -static char __pyx_k__ru_utime[] = "ru_utime"; -static char __pyx_k__shortest[] = "shortest"; -static char __pyx_k__span_dec[] = "span_dec"; -static char __pyx_k__span_inc[] = "span_inc"; -static char __pyx_k__word_ids[] = "word_ids"; -static char __pyx_k__Exception[] = "Exception"; -static char __pyx_k__INCREMENT[] = "INCREMENT"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k____enter__[] = "__enter__"; -static char __pyx_k__alignment[] = "alignment"; -static char __pyx_k__enumerate[] = "enumerate"; -static char __pyx_k__form_rule[] = "form_rule"; -static char __pyx_k__from_data[] = "from_data"; -static char __pyx_k__from_text[] = "from_text"; -static char __pyx_k__getLogger[] = "getLogger"; -static char __pyx_k__getrusage[] = "getrusage"; -static char __pyx_k__increment[] = "increment"; -static char __pyx_k__iteritems[] = "iteritems"; -static char __pyx_k__itertools[] = "itertools"; -static char __pyx_k__min_bound[] = "min_bound"; -static char __pyx_k__new_lex_i[] = "new_lex_i"; -static char __pyx_k__new_lex_j[] = "new_lex_j"; -static char __pyx_k__paircount[] = "paircount"; -static char __pyx_k__partition[] = "partition"; -static char __pyx_k__phrases_e[] = "phrases_e"; -static char __pyx_k__phrases_f[] = "phrases_f"; -static char __pyx_k__reachable[] = "reachable"; -static char __pyx_k__read_text[] = "read_text"; -static char __pyx_k__samples_f[] = "samples_f"; -static char __pyx_k__use_index[] = "use_index"; -static char __pyx_k__IndexError[] = "IndexError"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k____import__[] = "__import__"; -static char __pyx_k__alignments[] = "alignments"; -static char __pyx_k__from_stats[] = "from_stats"; -static char __pyx_k__input_span[] = "input_span"; -static char __pyx_k__itervalues[] = "itervalues"; -static char __pyx_k__max_chunks[] = "max_chunks"; -static char __pyx_k__max_length[] = "max_length"; -static char __pyx_k__namedtuple[] = "namedtuple"; -static char __pyx_k__phrases_al[] = "phrases_al"; -static char __pyx_k__phrases_fe[] = "phrases_fe"; -static char __pyx_k__plus_links[] = "plus_links"; -static char __pyx_k__precompute[] = "precompute"; -static char __pyx_k__span_check[] = "span_check"; -static char __pyx_k__write_text[] = "write_text"; -static char __pyx_k__END_OF_FILE[] = "END_OF_FILE"; -static char __pyx_k__END_OF_LINE[] = "END_OF_LINE"; -static char __pyx_k__RUSAGE_SELF[] = "RUSAGE_SELF"; -static char __pyx_k__collections[] = "collections"; -static char __pyx_k__defaultdict[] = "defaultdict"; -static char __pyx_k__from_binary[] = "from_binary"; -static char __pyx_k__initial_len[] = "initial_len"; -static char __pyx_k__input_match[] = "input_match"; -static char __pyx_k__monitor_cpu[] = "monitor_cpu"; -static char __pyx_k__next_states[] = "next_states"; -static char __pyx_k__old_last_nt[] = "old_last_nt"; -static char __pyx_k__precomputed[] = "precomputed"; -static char __pyx_k__read_binary[] = "read_binary"; -static char __pyx_k__read_bitext[] = "read_bitext"; -static char __pyx_k__sample_size[] = "sample_size"; -static char __pyx_k__suffix_link[] = "suffix_link"; -static char __pyx_k__use_sent_id[] = "use_sent_id"; -static char __pyx_k___doquicksort[] = "_doquicksort"; -static char __pyx_k__decode_words[] = "decode_words"; -static char __pyx_k__encode_words[] = "encode_words"; -static char __pyx_k__gzip_or_text[] = "gzip_or_text"; -static char __pyx_k__make_lattice[] = "make_lattice"; -static char __pyx_k__min_gap_size[] = "min_gap_size"; -static char __pyx_k__nt_collision[] = "nt_collision"; -static char __pyx_k__StopIteration[] = "StopIteration"; -static char __pyx_k__alphabet_size[] = "alphabet_size"; -static char __pyx_k__from_iterable[] = "from_iterable"; -static char __pyx_k__fsample_count[] = "fsample_count"; -static char __pyx_k__get_f_phrases[] = "get_f_phrases"; -static char __pyx_k__new_min_bound[] = "new_min_bound"; -static char __pyx_k__test_sentence[] = "test_sentence"; -static char __pyx_k__tight_phrases[] = "tight_phrases"; -static char __pyx_k__FeatureContext[] = "FeatureContext"; -static char __pyx_k____pyx_vtable__[] = "__pyx_vtable__"; -static char __pyx_k__decode_lattice[] = "decode_lattice"; -static char __pyx_k__pattern2phrase[] = "pattern2phrase"; -static char __pyx_k__read_text_data[] = "read_text_data"; -static char __pyx_k__by_slack_factor[] = "by_slack_factor"; -static char __pyx_k__decode_sentence[] = "decode_sentence"; -static char __pyx_k__get_next_states[] = "get_next_states"; -static char __pyx_k__num_subpatterns[] = "num_subpatterns"; -static char __pyx_k__phrase_location[] = "phrase_location"; -static char __pyx_k__precompute_file[] = "precompute_file"; -static char __pyx_k__precompute_rank[] = "precompute_rank"; -static char __pyx_k__use_baeza_yates[] = "use_baeza_yates"; -static char __pyx_k__word_alignments[] = "word_alignments"; -static char __pyx_k__INITIAL_CAPACITY[] = "INITIAL_CAPACITY"; -static char __pyx_k__max_initial_size[] = "max_initial_size"; -static char __pyx_k__max_nonterminals[] = "max_nonterminals"; -static char __pyx_k__reachable_buffer[] = "reachable_buffer"; -static char __pyx_k__use_collocations[] = "use_collocations"; -static char __pyx_k__max_target_chunks[] = "max_target_chunks"; -static char __pyx_k__max_target_length[] = "max_target_length"; -static char __pyx_k__online_ctx_lookup[] = "online_ctx_lookup"; -static char __pyx_k__train_min_gap_size[] = "train_min_gap_size"; -static char __pyx_k__pattern2phrase_plus[] = "pattern2phrase_plus"; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_[] = ","; +static char __pyx_k_0[] = "0"; +static char __pyx_k_1[] = "1"; +static char __pyx_k_X[] = "X "; +static char __pyx_k_a[] = "a"; +static char __pyx_k_d[] = "%d "; +static char __pyx_k_e[] = "e"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_r[] = "r"; +static char __pyx_k_s[] = "%s "; +static char __pyx_k_w[] = "w"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k__2[] = "]"; +static char __pyx_k__6[] = "\n"; +static char __pyx_k_al[] = "al"; +static char __pyx_k_gc[] = "gc"; +static char __pyx_k_gz[] = ".gz"; +static char __pyx_k_nt[] = "nt"; +static char __pyx_k_sa[] = "sa"; +static char __pyx_k_wc[] = "wc"; +static char __pyx_k_0_1[] = "{0}-{1}"; +static char __pyx_k_EPS[] = "*EPS*"; +static char __pyx_k_SEP[] = "_SEP_"; +static char __pyx_k_X_2[] = "[X]"; +static char __pyx_k__10[] = " ||| "; +static char __pyx_k__21[] = "-"; +static char __pyx_k__32[] = ""; +static char __pyx_k__34[] = " "; +static char __pyx_k__41[] = " ("; +static char __pyx_k__42[] = ")"; +static char __pyx_k__45[] = "\\"; +static char __pyx_k__46[] = " "; +static char __pyx_k__63[] = "{"; + static char __pyx_k__64[] = "("; +static char __pyx_k__65[] = "}"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_cmp[] = "cmp"; +static char __pyx_k_col[] = "col"; +static char __pyx_k_d_d[] = "%d-%d "; +static char __pyx_k_d_s[] = "%d %s "; +static char __pyx_k_e_i[] = "e_i"; +static char __pyx_k_e_j[] = "e_j"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_f_i[] = "f_i"; +static char __pyx_k_f_j[] = "f_j"; +static char __pyx_k_get[] = "get"; +static char __pyx_k_isa[] = "isa"; +static char __pyx_k_ito[] = "ito"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_len[] = "len="; +static char __pyx_k_lhs[] = "lhs"; +static char __pyx_k_low[] = "low"; +static char __pyx_k_map[] = "map"; +static char __pyx_k_max[] = "max"; +static char __pyx_k_ntc[] = "ntc"; +static char __pyx_k_pad[] = "pad"; +static char __pyx_k_pop[] = "pop"; +static char __pyx_k_res[] = "res"; +static char __pyx_k_s_2[] = "[%s]"; +static char __pyx_k_s_d[] = "%s %d "; +static char __pyx_k_s_s[] = "%s=%s"; +static char __pyx_k_set[] = "set"; +static char __pyx_k_sym[] = "sym"; +static char __pyx_k_vec[] = "vec"; +static char __pyx_k_zip[] = "zip"; +static char __pyx_k_NULL[] = "NULL"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_dist[] = "dist"; +static char __pyx_k_exit[] = "__exit__"; +static char __pyx_k_gzip[] = "gzip"; +static char __pyx_k_high[] = "high"; +static char __pyx_k_info[] = "info"; +static char __pyx_k_join[] = "join"; +static char __pyx_k_link[] = "link"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_meta[] = "meta"; +static char __pyx_k_name[] = "name"; +static char __pyx_k_open[] = "open"; +static char __pyx_k_seek[] = "seek"; +static char __pyx_k_send[] = "send"; +static char __pyx_k_side[] = "side"; +static char __pyx_k_size[] = "size"; +static char __pyx_k_skip[] = "skip"; +static char __pyx_k_stop[] = "stop"; +static char __pyx_k_syms[] = "syms"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_warn[] = "warn"; +static char __pyx_k_word[] = "word"; +static char __pyx_k_arity[] = "arity"; +static char __pyx_k_bilex[] = "bilex"; +static char __pyx_k_chain[] = "chain"; +static char __pyx_k_close[] = "close"; +static char __pyx_k_d_d_2[] = "%d-%d"; +static char __pyx_k_d_f_f[] = "%d %f %f "; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_enter[] = "__enter__"; +static char __pyx_k_eword[] = "eword"; +static char __pyx_k_fword[] = "fword"; +static char __pyx_k_ifrom[] = "ifrom"; +static char __pyx_k_index[] = "index"; +static char __pyx_k_isvar[] = "isvar"; +static char __pyx_k_lex_i[] = "lex_i"; +static char __pyx_k_lex_j[] = "lex_j"; +static char __pyx_k_links[] = "links"; +static char __pyx_k_merge[] = "merge"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_reset[] = "reset"; +static char __pyx_k_s_d_2[] = "[%s,%d]"; +static char __pyx_k_split[] = "split"; +static char __pyx_k_start[] = "start"; +static char __pyx_k_stats[] = "stats"; +static char __pyx_k_throw[] = "throw"; +static char __pyx_k_toMap[] = "toMap"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_words[] = "words"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_append[] = "append"; +static char __pyx_k_e_span[] = "e_span"; +static char __pyx_k_e_text[] = "e_text"; +static char __pyx_k_earray[] = "earray"; +static char __pyx_k_extend[] = "extend"; +static char __pyx_k_f_span[] = "f_span"; +static char __pyx_k_f_text[] = "f_text"; +static char __pyx_k_fcount[] = "fcount"; +static char __pyx_k_format[] = "format"; +static char __pyx_k_fwords[] = "fwords"; +static char __pyx_k_get_id[] = "get_id"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_insert[] = "insert"; +static char __pyx_k_link_i[] = "link_i"; +static char __pyx_k_link_j[] = "link_j"; +static char __pyx_k_logger[] = "logger"; +static char __pyx_k_lookup[] = "lookup"; +static char __pyx_k_name_2[] = "__name__"; +static char __pyx_k_offset[] = "offset"; +static char __pyx_k_online[] = "online"; +static char __pyx_k_phrase[] = "phrase"; +static char __pyx_k_q3sort[] = "q3sort"; +static char __pyx_k_sa_low[] = "sa_low"; +static char __pyx_k_sample[] = "sample"; +static char __pyx_k_sarray[] = "sarray"; +static char __pyx_k_scorer[] = "scorer"; +static char __pyx_k_scores[] = "scores"; +static char __pyx_k_sorted[] = "sorted"; +static char __pyx_k_source[] = "source"; +static char __pyx_k_unlink[] = "unlink"; +static char __pyx_k_update[] = "update"; +static char __pyx_k_Counter[] = "Counter"; +static char __pyx_k_IntList[] = "IntList["; +static char __pyx_k_X_0_1_2[] = "[X] ||| {0} ||| {1} ||| {2}"; +static char __pyx_k_advance[] = "advance"; +static char __pyx_k_arr_low[] = "arr_low"; +static char __pyx_k_cdec_sa[] = "cdec.sa"; +static char __pyx_k_collect[] = "collect"; +static char __pyx_k_columns[] = "_columns"; +static char __pyx_k_e_words[] = "e_words"; +static char __pyx_k_edarray[] = "edarray"; +static char __pyx_k_ephrase[] = "ephrase"; +static char __pyx_k_extract[] = "extract"; +static char __pyx_k_f_words[] = "f_words"; +static char __pyx_k_fphrase[] = "fphrase"; +static char __pyx_k_fsarray[] = "fsarray"; +static char __pyx_k_genexpr[] = "genexpr"; +static char __pyx_k_lattice[] = "lattice"; +static char __pyx_k_logging[] = "logging"; +static char __pyx_k_matches[] = "matches"; +static char __pyx_k_new_e_i[] = "new_e_i"; +static char __pyx_k_new_e_j[] = "new_e_j"; +static char __pyx_k_nt_open[] = "nt_open"; +static char __pyx_k_pathlen[] = "pathlen"; +static char __pyx_k_sa_high[] = "sa_high"; +static char __pyx_k_sampler[] = "sampler"; +static char __pyx_k_spanlen[] = "spanlen"; +static char __pyx_k_warning[] = "warning"; +static char __pyx_k_GzipFile[] = "GzipFile"; +static char __pyx_k_arr_high[] = "arr_high"; +static char __pyx_k_category[] = "category"; +static char __pyx_k_children[] = "children"; +static char __pyx_k_ctx_name[] = "ctx_name"; +static char __pyx_k_curr_idx[] = "curr_idx"; +static char __pyx_k_extended[] = "extended"; +static char __pyx_k_filename[] = "filename"; +static char __pyx_k_frontier[] = "frontier"; +static char __pyx_k_get_e_id[] = "get_e_id"; +static char __pyx_k_get_f_id[] = "get_f_id"; +static char __pyx_k_get_word[] = "get_word"; +static char __pyx_k_getchunk[] = "getchunk"; +static char __pyx_k_min_dist[] = "min_dist"; +static char __pyx_k_resource[] = "resource"; +static char __pyx_k_ru_stime[] = "ru_stime"; +static char __pyx_k_ru_utime[] = "ru_utime"; +static char __pyx_k_shortest[] = "shortest"; +static char __pyx_k_span_dec[] = "span_dec"; +static char __pyx_k_span_inc[] = "span_inc"; +static char __pyx_k_word_ids[] = "word_ids"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_INCREMENT[] = "INCREMENT"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_alignment[] = "alignment"; +static char __pyx_k_enumerate[] = "enumerate"; +static char __pyx_k_form_rule[] = "form_rule"; +static char __pyx_k_from_data[] = "from_data"; +static char __pyx_k_from_text[] = "from_text"; +static char __pyx_k_getLogger[] = "getLogger"; +static char __pyx_k_getrusage[] = "getrusage"; +static char __pyx_k_increment[] = "increment"; +static char __pyx_k_iteritems[] = "iteritems"; +static char __pyx_k_itertools[] = "itertools"; +static char __pyx_k_min_bound[] = "min_bound"; +static char __pyx_k_new_lex_i[] = "new_lex_i"; +static char __pyx_k_new_lex_j[] = "new_lex_j"; +static char __pyx_k_paircount[] = "paircount"; +static char __pyx_k_partition[] = "partition"; +static char __pyx_k_phrases_e[] = "phrases_e"; +static char __pyx_k_phrases_f[] = "phrases_f"; +static char __pyx_k_reachable[] = "reachable"; +static char __pyx_k_read_text[] = "read_text"; +static char __pyx_k_s_s_6f_6f[] = "%s %s %.6f %.6f\n"; +static char __pyx_k_samples_f[] = "samples_f"; +static char __pyx_k_use_index[] = "use_index"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_alignments[] = "alignments"; +static char __pyx_k_from_stats[] = "from_stats"; +static char __pyx_k_input_span[] = "input_span"; +static char __pyx_k_itervalues[] = "itervalues"; +static char __pyx_k_max_chunks[] = "max_chunks"; +static char __pyx_k_max_length[] = "max_length"; +static char __pyx_k_namedtuple[] = "namedtuple"; +static char __pyx_k_phrases_al[] = "phrases_al"; +static char __pyx_k_phrases_fe[] = "phrases_fe"; +static char __pyx_k_plus_links[] = "plus_links"; +static char __pyx_k_precompute[] = "precompute"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_span_check[] = "span_check"; +static char __pyx_k_write_text[] = "write_text"; +static char __pyx_k_END_OF_FILE[] = "END_OF_FILE"; +static char __pyx_k_END_OF_LINE[] = "END_OF_LINE"; +static char __pyx_k_RUSAGE_SELF[] = "RUSAGE_SELF"; +static char __pyx_k_cdec_sa__sa[] = "cdec.sa._sa"; +static char __pyx_k_collections[] = "collections"; +static char __pyx_k_d_sentences[] = " %d sentences"; +static char __pyx_k_defaultdict[] = "defaultdict"; +static char __pyx_k_doquicksort[] = "_doquicksort"; +static char __pyx_k_from_binary[] = "from_binary"; +static char __pyx_k_initial_len[] = "initial_len"; +static char __pyx_k_input_match[] = "input_match"; +static char __pyx_k_monitor_cpu[] = "monitor_cpu"; +static char __pyx_k_next_states[] = "next_states"; +static char __pyx_k_old_last_nt[] = "old_last_nt"; +static char __pyx_k_precomputed[] = "precomputed"; +static char __pyx_k_read_binary[] = "read_binary"; +static char __pyx_k_read_bitext[] = "read_bitext"; +static char __pyx_k_sample_size[] = "sample_size"; +static char __pyx_k_suffix_link[] = "suffix_link"; +static char __pyx_k_use_sent_id[] = "use_sent_id"; +static char __pyx_k_decode_words[] = "decode_words"; +static char __pyx_k_encode_words[] = "encode_words"; +static char __pyx_k_gzip_or_text[] = "gzip_or_text"; +static char __pyx_k_make_lattice[] = "make_lattice"; +static char __pyx_k_min_gap_size[] = "min_gap_size"; +static char __pyx_k_nt_collision[] = "nt_collision"; +static char __pyx_k_StopIteration[] = "StopIteration"; +static char __pyx_k_alphabet_size[] = "alphabet_size"; +static char __pyx_k_double_binary[] = "double binary"; +static char __pyx_k_from_iterable[] = "from_iterable"; +static char __pyx_k_fsample_count[] = "fsample_count"; +static char __pyx_k_get_f_phrases[] = "get_f_phrases"; +static char __pyx_k_new_min_bound[] = "new_min_bound"; +static char __pyx_k_test_sentence[] = "test_sentence"; +static char __pyx_k_tight_phrases[] = "tight_phrases"; +static char __pyx_k_FeatureContext[] = "FeatureContext"; +static char __pyx_k_decode_lattice[] = "decode_lattice"; +static char __pyx_k_pattern2phrase[] = "pattern2phrase"; +static char __pyx_k_read_text_data[] = "read_text_data"; +static char __pyx_k_Finalizing_sort[] = " Finalizing sort..."; +static char __pyx_k_Unaligned_chunk[] = "Unaligned chunk"; +static char __pyx_k_by_slack_factor[] = "by_slack_factor"; +static char __pyx_k_decode_sentence[] = "decode_sentence"; +static char __pyx_k_get_next_states[] = "get_next_states"; +static char __pyx_k_num_subpatterns[] = "num_subpatterns"; +static char __pyx_k_phrase_location[] = "phrase_location"; +static char __pyx_k_precompute_file[] = "precompute_file"; +static char __pyx_k_precompute_rank[] = "precompute_rank"; +static char __pyx_k_use_baeza_yates[] = "use_baeza_yates"; +static char __pyx_k_word_alignments[] = "word_alignments"; +static char __pyx_k_INITIAL_CAPACITY[] = "INITIAL_CAPACITY"; +static char __pyx_k_max_initial_size[] = "max_initial_size"; +static char __pyx_k_max_nonterminals[] = "max_nonterminals"; +static char __pyx_k_reachable_buffer[] = "reachable_buffer"; +static char __pyx_k_s_not_in_IntList[] = "%s not in IntList"; +static char __pyx_k_use_collocations[] = "use_collocations"; +static char __pyx_k_max_target_chunks[] = "max_target_chunks"; +static char __pyx_k_max_target_length[] = "max_target_length"; +static char __pyx_k_online_ctx_lookup[] = "online_ctx_lookup"; +static char __pyx_k_Keyword_trie_error[] = "Keyword trie error"; +static char __pyx_k_Sort_error_in_CLex[] = "Sort error in CLex"; +static char __pyx_k_train_min_gap_size[] = "train_min_gap_size"; +static char __pyx_k_LCP_array_completed[] = "LCP array completed"; +static char __pyx_k_input_locals_lambda[] = "input.."; +static char __pyx_k_pattern2phrase_plus[] = "pattern2phrase_plus"; +static char __pyx_k_Invalid_LHS_symbol_d[] = "Invalid LHS symbol: %d"; +static char __pyx_k_No_aligned_terminals[] = "No aligned terminals"; +static char __pyx_k_OnlineFeatureContext[] = "OnlineFeatureContext"; +static char __pyx_k_Refining_sort_depth_d[] = " Refining, sort depth = %d"; +static char __pyx_k_cinit___locals_lambda[] = "__cinit__.."; +static char __pyx_k_write_enhanced_handle[] = "write_enhanced_handle"; +static char __pyx_k_Computing_collocations[] = " Computing collocations..."; +static char __pyx_k_Constructing_LCP_array[] = "Constructing LCP array"; +static char __pyx_k_Extract_time_f_seconds[] = " Extract time = %f seconds"; +static char __pyx_k_require_aligned_chunks[] = "require_aligned_chunks"; +static char __pyx_k_train_max_initial_size[] = "train_max_initial_size"; +static char __pyx_k_form_rule_locals_lambda[] = "form_rule.."; +static char __pyx_k_Intersect_time_f_seconds[] = " Intersect time = %f seconds"; +static char __pyx_k_require_aligned_terminal[] = "require_aligned_terminal"; +static char __pyx_k_Refinement_took_f_seconds[] = " Refinement took %f seconds"; +static char __pyx_k_get_all_nodes_isteps_away[] = "get_all_nodes_isteps_away"; +static char __pyx_k_precompute_secondary_rank[] = "precompute_secondary_rank"; +static char __pyx_k_Bucket_sort_took_f_seconds[] = " Bucket sort took %f seconds"; +static char __pyx_k_Computing_inverted_indexes[] = " Computing inverted indexes..."; +static char __pyx_k_Gaps_are_not_tight_phrases[] = "Gaps are not tight phrases"; +static char __pyx_k_add_instance_locals_extract[] = "add_instance..extract"; +static char __pyx_k_get_precomputed_collocation[] = "get_precomputed_collocation"; +static char __pyx_k_get_f_phrases_locals_extract[] = "get_f_phrases..extract"; +static char __pyx_k_Precomputation_took_f_seconds[] = "Precomputation took %f seconds"; +static char __pyx_k_Sampling_strategy_no_sampling[] = "Sampling strategy: no sampling"; +static char __pyx_k_Illegal_key_type_s_for_IntList[] = "Illegal key type %s for IntList"; +static char __pyx_k_Unable_to_extract_basic_phrase[] = "Unable to extract basic phrase"; +static char __pyx_k_Processing_precomputations_took[] = "Processing precomputations took %f seconds"; +static char __pyx_k_RANK_d_COUNT_COST_d_d_CUMUL_d_d[] = "RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d"; +static char __pyx_k_Requested_index_d_d_of_d_length[] = "Requested index %d:%d of %d-length IntList"; +static char __pyx_k_d_d_out_of_bounds_I_d_J_d_in_li[] = "%d-%d out of bounds (I=%d,J=%d) in line %d\n"; +static char __pyx_k_usr0_home_mdenkows_cdec_git_pyt[] = "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi"; +static char __pyx_k_Converting_d_hash_keys_on_precom[] = "Converting %d hash keys on precomputed inverted index... "; +static char __pyx_k_Didn_t_extract_anything_from_d_d[] = "Didn't extract anything from [%d, %d] -> [%d, %d]"; +static char __pyx_k_ERROR_unexpected_pattern_s_in_se[] = "ERROR: unexpected pattern %s in set of precomputed collocations"; +static char __pyx_k_Inside_edges_of_following_subphr[] = "Inside edges of following subphrase are not tight"; +static char __pyx_k_Inside_edges_of_preceding_subphr[] = "Inside edges of preceding subphrase are not tight"; +static char __pyx_k_Must_specify_an_alignment_object[] = "Must specify an alignment object"; +static char __pyx_k_No_online_bilexical_dictionary_s[] = "No online bilexical dictionary specified, not updating lexical weights"; +static char __pyx_k_Precomputation_done_with_max_ini[] = "Precomputation done with max initial size %d, decoder uses %d"; +static char __pyx_k_Precomputation_done_with_max_non[] = "Precomputation done with max nonterminals %d, decoder uses %d"; +static char __pyx_k_Precomputation_done_with_max_ter[] = "Precomputation done with max terminals %d, decoder uses %d"; +static char __pyx_k_Precomputation_done_with_min_gap[] = "Precomputation done with min gap size %d, decoder uses %d"; +static char __pyx_k_Precomputed_collocations_for_d_p[] = "Precomputed collocations for %d patterns out of %d possible (upper bound %d)"; +static char __pyx_k_Precomputed_inverted_index_for_d[] = "Precomputed inverted index for %d patterns "; +static char __pyx_k_Precomputing_frequent_intersecti[] = "Precomputing frequent intersections"; +static char __pyx_k_Reading_precomputed_data_from_fi[] = "Reading precomputed data from file %s... "; +static char __pyx_k_Requested_index_d_of_d_length_Fl[] = "Requested index %d of %d-length FloatList"; +static char __pyx_k_Requested_index_d_of_d_length_In[] = "Requested index %d of %d-length IntList"; +static char __pyx_k_Sampling_strategy_uniform_max_sa[] = "Sampling strategy: uniform, max sample size = %d"; +static char __pyx_k_Subphrase_d_d_failed_integrity_c[] = "Subphrase [%d, %d] failed integrity check"; +static char __pyx_k_Suffix_array_construction_took_f[] = "Suffix array construction took %f seconds"; +static char __pyx_k_Total_time_for_rule_lookup_extra[] = "Total time for rule lookup, extraction, and scoring = %f seconds"; +static char __pyx_k_Unexpected_condition_found_in_q3[] = "Unexpected condition found in q3sort: sort from %d to %d"; +static char __pyx_k_input_locals_lambda_locals_lambd[] = "input...."; +static char __pyx_k_usr0_home_mdenkows_cdec_git_pyt_2[] = "/usr0/home/mdenkows/cdec-git/python/cdec/sa/_sa.pyx"; +static char __pyx_k_usr0_home_mdenkows_cdec_git_pyt_3[] = "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi"; +static char __pyx_k_Converting_d_hash_keys_on_precom_2[] = "Converting %d hash keys on precomputed collocations... "; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_kp_s_0; +static PyObject *__pyx_kp_s_0_1; static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_kp_s_10; -static PyObject *__pyx_n_s_101; -static PyObject *__pyx_n_s_102; -static PyObject *__pyx_kp_s_104; -static PyObject *__pyx_kp_s_105; -static PyObject *__pyx_n_s_107; -static PyObject *__pyx_n_s_108; -static PyObject *__pyx_kp_s_110; -static PyObject *__pyx_kp_s_112; -static PyObject *__pyx_kp_s_113; -static PyObject *__pyx_kp_s_114; -static PyObject *__pyx_kp_s_115; -static PyObject *__pyx_kp_s_116; -static PyObject *__pyx_kp_s_117; -static PyObject *__pyx_kp_s_118; -static PyObject *__pyx_kp_s_119; -static PyObject *__pyx_kp_s_120; -static PyObject *__pyx_kp_s_121; -static PyObject *__pyx_kp_s_122; -static PyObject *__pyx_n_s_123; -static PyObject *__pyx_kp_s_124; -static PyObject *__pyx_n_s_125; -static PyObject *__pyx_kp_s_126; -static PyObject *__pyx_n_s_128; -static PyObject *__pyx_n_s_129; -static PyObject *__pyx_kp_s_130; -static PyObject *__pyx_kp_s_131; -static PyObject *__pyx_kp_s_132; -static PyObject *__pyx_kp_s_133; -static PyObject *__pyx_kp_s_134; -static PyObject *__pyx_kp_s_135; -static PyObject *__pyx_kp_s_136; -static PyObject *__pyx_kp_s_137; -static PyObject *__pyx_kp_s_138; -static PyObject *__pyx_kp_s_139; -static PyObject *__pyx_kp_s_14; -static PyObject *__pyx_kp_s_140; -static PyObject *__pyx_kp_s_144; -static PyObject *__pyx_n_s_145; -static PyObject *__pyx_n_s_147; -static PyObject *__pyx_kp_s_15; -static PyObject *__pyx_kp_s_150; -static PyObject *__pyx_kp_s_151; -static PyObject *__pyx_n_s_152; -static PyObject *__pyx_n_s_155; -static PyObject *__pyx_kp_s_156; -static PyObject *__pyx_kp_s_158; -static PyObject *__pyx_kp_s_161; -static PyObject *__pyx_kp_s_165; -static PyObject *__pyx_kp_s_19; -static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_kp_s_23; -static PyObject *__pyx_kp_s_27; -static PyObject *__pyx_n_s_29; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_33; -static PyObject *__pyx_kp_s_37; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_44; -static PyObject *__pyx_kp_s_47; -static PyObject *__pyx_kp_s_48; -static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_50; -static PyObject *__pyx_kp_s_52; -static PyObject *__pyx_kp_s_54; -static PyObject *__pyx_kp_s_58; -static PyObject *__pyx_kp_s_6; -static PyObject *__pyx_kp_s_60; -static PyObject *__pyx_kp_s_61; -static PyObject *__pyx_kp_s_62; -static PyObject *__pyx_kp_s_64; -static PyObject *__pyx_kp_s_66; -static PyObject *__pyx_kp_s_67; -static PyObject *__pyx_kp_s_68; -static PyObject *__pyx_kp_s_69; -static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_kp_s_70; -static PyObject *__pyx_kp_s_71; -static PyObject *__pyx_n_s_72; -static PyObject *__pyx_n_s_73; -static PyObject *__pyx_kp_s_74; -static PyObject *__pyx_kp_s_76; -static PyObject *__pyx_kp_s_78; -static PyObject *__pyx_kp_s_8; -static PyObject *__pyx_kp_s_80; -static PyObject *__pyx_kp_s_85; -static PyObject *__pyx_kp_s_86; -static PyObject *__pyx_kp_s_87; -static PyObject *__pyx_kp_s_88; -static PyObject *__pyx_kp_s_89; -static PyObject *__pyx_kp_s_9; -static PyObject *__pyx_kp_s_90; -static PyObject *__pyx_kp_s_91; -static PyObject *__pyx_kp_s_92; -static PyObject *__pyx_kp_s_93; -static PyObject *__pyx_kp_s_94; -static PyObject *__pyx_kp_s_96; -static PyObject *__pyx_kp_s_97; -static PyObject *__pyx_kp_s__0; -static PyObject *__pyx_kp_s__1; -static PyObject *__pyx_n_s__Counter; -static PyObject *__pyx_n_s__END_OF_FILE; -static PyObject *__pyx_n_s__END_OF_LINE; -static PyObject *__pyx_n_s__Exception; -static PyObject *__pyx_n_s__FeatureContext; -static PyObject *__pyx_n_s__GzipFile; -static PyObject *__pyx_n_s__INCREMENT; -static PyObject *__pyx_n_s__INITIAL_CAPACITY; -static PyObject *__pyx_n_s__IndexError; -static PyObject *__pyx_n_s__NULL; -static PyObject *__pyx_n_s__RUSAGE_SELF; -static PyObject *__pyx_n_s__StopIteration; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____enter__; -static PyObject *__pyx_n_s____exit__; -static PyObject *__pyx_n_s____import__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____name__; -static PyObject *__pyx_n_s____pyx_vtable__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___columns; -static PyObject *__pyx_n_s___doquicksort; -static PyObject *__pyx_n_s__a; -static PyObject *__pyx_n_s__advance; -static PyObject *__pyx_n_s__al; -static PyObject *__pyx_n_s__alignment; -static PyObject *__pyx_n_s__alignments; -static PyObject *__pyx_n_s__alphabet_size; -static PyObject *__pyx_n_s__append; -static PyObject *__pyx_n_s__args; -static PyObject *__pyx_n_s__arity; -static PyObject *__pyx_n_s__arr; -static PyObject *__pyx_n_s__arr_high; -static PyObject *__pyx_n_s__arr_low; -static PyObject *__pyx_n_s__by_slack_factor; -static PyObject *__pyx_n_s__category; -static PyObject *__pyx_n_s__chain; -static PyObject *__pyx_n_s__children; -static PyObject *__pyx_n_s__close; -static PyObject *__pyx_n_s__cmp; -static PyObject *__pyx_n_s__col; -static PyObject *__pyx_n_s__collect; -static PyObject *__pyx_n_s__collections; -static PyObject *__pyx_n_s__ctx_name; -static PyObject *__pyx_n_s__curr_idx; -static PyObject *__pyx_n_s__debug; -static PyObject *__pyx_n_s__decode_lattice; -static PyObject *__pyx_n_s__decode_sentence; -static PyObject *__pyx_n_s__decode_words; -static PyObject *__pyx_n_s__defaultdict; -static PyObject *__pyx_n_s__dist; -static PyObject *__pyx_n_s__e; -static PyObject *__pyx_n_s__e_i; -static PyObject *__pyx_n_s__e_j; -static PyObject *__pyx_n_s__e_span; -static PyObject *__pyx_n_s__e_text; -static PyObject *__pyx_n_s__e_words; -static PyObject *__pyx_n_s__earray; -static PyObject *__pyx_n_s__edarray; -static PyObject *__pyx_n_s__encode_words; -static PyObject *__pyx_n_s__end; -static PyObject *__pyx_n_s__enumerate; -static PyObject *__pyx_n_s__ephrase; -static PyObject *__pyx_n_s__eword; -static PyObject *__pyx_n_s__extend; -static PyObject *__pyx_n_s__extended; -static PyObject *__pyx_n_s__extract; -static PyObject *__pyx_n_s__f; -static PyObject *__pyx_n_s__f_i; -static PyObject *__pyx_n_s__f_j; -static PyObject *__pyx_n_s__f_span; -static PyObject *__pyx_n_s__f_text; -static PyObject *__pyx_n_s__f_words; -static PyObject *__pyx_n_s__fcount; -static PyObject *__pyx_n_s__filename; -static PyObject *__pyx_n_s__form_rule; -static PyObject *__pyx_n_s__format; -static PyObject *__pyx_n_s__fphrase; -static PyObject *__pyx_n_s__from_binary; -static PyObject *__pyx_n_s__from_data; -static PyObject *__pyx_n_s__from_iterable; -static PyObject *__pyx_n_s__from_stats; -static PyObject *__pyx_n_s__from_text; -static PyObject *__pyx_n_s__frontier; -static PyObject *__pyx_n_s__fsample_count; -static PyObject *__pyx_n_s__fsarray; -static PyObject *__pyx_n_s__fword; -static PyObject *__pyx_n_s__fwords; -static PyObject *__pyx_n_s__gc; -static PyObject *__pyx_n_s__genexpr; -static PyObject *__pyx_n_s__get; -static PyObject *__pyx_n_s__getLogger; -static PyObject *__pyx_n_s__get_e_id; -static PyObject *__pyx_n_s__get_f_id; -static PyObject *__pyx_n_s__get_f_phrases; -static PyObject *__pyx_n_s__get_id; -static PyObject *__pyx_n_s__get_next_states; -static PyObject *__pyx_n_s__get_word; -static PyObject *__pyx_n_s__getchunk; -static PyObject *__pyx_n_s__getrusage; -static PyObject *__pyx_n_s__gzip; -static PyObject *__pyx_n_s__gzip_or_text; -static PyObject *__pyx_n_s__h; -static PyObject *__pyx_n_s__high; -static PyObject *__pyx_n_s__i; -static PyObject *__pyx_n_s__ifrom; -static PyObject *__pyx_n_s__increment; -static PyObject *__pyx_n_s__index; -static PyObject *__pyx_n_s__info; -static PyObject *__pyx_n_s__initial_len; -static PyObject *__pyx_n_s__input_match; -static PyObject *__pyx_n_s__input_span; -static PyObject *__pyx_n_s__insert; -static PyObject *__pyx_n_s__isa; -static PyObject *__pyx_n_s__isvar; -static PyObject *__pyx_n_s__iteritems; -static PyObject *__pyx_n_s__itertools; -static PyObject *__pyx_n_s__itervalues; -static PyObject *__pyx_n_s__ito; -static PyObject *__pyx_n_s__j; -static PyObject *__pyx_n_s__join; -static PyObject *__pyx_n_s__k; -static PyObject *__pyx_n_s__key; -static PyObject *__pyx_n_s__lattice; -static PyObject *__pyx_n_s__lex_i; -static PyObject *__pyx_n_s__lex_j; -static PyObject *__pyx_n_s__lhs; -static PyObject *__pyx_n_s__link; -static PyObject *__pyx_n_s__link_i; -static PyObject *__pyx_n_s__link_j; -static PyObject *__pyx_n_s__links; -static PyObject *__pyx_n_s__logger; -static PyObject *__pyx_n_s__logging; -static PyObject *__pyx_n_s__lookup; -static PyObject *__pyx_n_s__low; -static PyObject *__pyx_n_s__make_lattice; -static PyObject *__pyx_n_s__map; -static PyObject *__pyx_n_s__matches; -static PyObject *__pyx_n_s__max; -static PyObject *__pyx_n_s__max_chunks; -static PyObject *__pyx_n_s__max_initial_size; -static PyObject *__pyx_n_s__max_length; -static PyObject *__pyx_n_s__max_nonterminals; -static PyObject *__pyx_n_s__max_target_chunks; -static PyObject *__pyx_n_s__max_target_length; -static PyObject *__pyx_n_s__merge; -static PyObject *__pyx_n_s__meta; -static PyObject *__pyx_n_s__min_bound; -static PyObject *__pyx_n_s__min_dist; -static PyObject *__pyx_n_s__min_gap_size; -static PyObject *__pyx_n_s__monitor_cpu; -static PyObject *__pyx_n_s__name; -static PyObject *__pyx_n_s__namedtuple; -static PyObject *__pyx_n_s__new_e_i; -static PyObject *__pyx_n_s__new_e_j; -static PyObject *__pyx_n_s__new_lex_i; -static PyObject *__pyx_n_s__new_lex_j; -static PyObject *__pyx_n_s__new_min_bound; -static PyObject *__pyx_n_s__next_states; -static PyObject *__pyx_n_s__nt; -static PyObject *__pyx_n_s__nt_collision; -static PyObject *__pyx_n_s__nt_open; -static PyObject *__pyx_n_s__ntc; -static PyObject *__pyx_n_s__num_subpatterns; -static PyObject *__pyx_n_s__offset; -static PyObject *__pyx_n_s__old_last_nt; -static PyObject *__pyx_n_s__online; -static PyObject *__pyx_n_s__online_ctx_lookup; -static PyObject *__pyx_n_s__open; -static PyObject *__pyx_n_s__pad; -static PyObject *__pyx_n_s__paircount; -static PyObject *__pyx_n_s__partition; -static PyObject *__pyx_n_s__pathlen; -static PyObject *__pyx_n_s__pattern2phrase; -static PyObject *__pyx_n_s__pattern2phrase_plus; -static PyObject *__pyx_n_s__phrase; -static PyObject *__pyx_n_s__phrase_location; -static PyObject *__pyx_n_s__phrases_al; -static PyObject *__pyx_n_s__phrases_e; -static PyObject *__pyx_n_s__phrases_f; -static PyObject *__pyx_n_s__phrases_fe; -static PyObject *__pyx_n_s__plus_links; -static PyObject *__pyx_n_s__pop; -static PyObject *__pyx_n_s__precompute; -static PyObject *__pyx_n_s__precompute_file; -static PyObject *__pyx_n_s__precompute_rank; -static PyObject *__pyx_n_s__precomputed; -static PyObject *__pyx_n_s__q3sort; -static PyObject *__pyx_n_s__range; -static PyObject *__pyx_n_s__reachable; -static PyObject *__pyx_n_s__reachable_buffer; -static PyObject *__pyx_n_s__read_binary; -static PyObject *__pyx_n_s__read_bitext; -static PyObject *__pyx_n_s__read_text; -static PyObject *__pyx_n_s__read_text_data; -static PyObject *__pyx_n_s__res; -static PyObject *__pyx_n_s__reset; -static PyObject *__pyx_n_s__resource; -static PyObject *__pyx_n_s__ru_stime; -static PyObject *__pyx_n_s__ru_utime; -static PyObject *__pyx_n_s__sa; -static PyObject *__pyx_n_s__sa_high; -static PyObject *__pyx_n_s__sa_low; -static PyObject *__pyx_n_s__sample; -static PyObject *__pyx_n_s__sample_size; -static PyObject *__pyx_n_s__sampler; -static PyObject *__pyx_n_s__samples_f; -static PyObject *__pyx_n_s__sarray; -static PyObject *__pyx_n_s__scorer; -static PyObject *__pyx_n_s__scores; -static PyObject *__pyx_n_s__seek; -static PyObject *__pyx_n_s__send; -static PyObject *__pyx_n_s__set; -static PyObject *__pyx_n_s__shortest; -static PyObject *__pyx_n_s__side; -static PyObject *__pyx_n_s__size; -static PyObject *__pyx_n_s__skip; -static PyObject *__pyx_n_s__sorted; -static PyObject *__pyx_n_s__source; -static PyObject *__pyx_n_s__span_check; -static PyObject *__pyx_n_s__span_dec; -static PyObject *__pyx_n_s__span_inc; -static PyObject *__pyx_n_s__spanlen; -static PyObject *__pyx_n_s__split; -static PyObject *__pyx_n_s__start; -static PyObject *__pyx_n_s__stats; -static PyObject *__pyx_n_s__stop; -static PyObject *__pyx_n_s__suffix_link; -static PyObject *__pyx_n_s__sym; -static PyObject *__pyx_n_s__syms; -static PyObject *__pyx_n_s__test_sentence; -static PyObject *__pyx_n_s__throw; -static PyObject *__pyx_n_s__tight_phrases; -static PyObject *__pyx_n_s__toMap; -static PyObject *__pyx_n_s__train_min_gap_size; -static PyObject *__pyx_n_s__unlink; -static PyObject *__pyx_n_s__use_baeza_yates; -static PyObject *__pyx_n_s__use_collocations; -static PyObject *__pyx_n_s__use_index; -static PyObject *__pyx_n_s__use_sent_id; -static PyObject *__pyx_n_s__value; -static PyObject *__pyx_n_s__vec; -static PyObject *__pyx_n_s__w; -static PyObject *__pyx_n_s__warn; -static PyObject *__pyx_n_s__wc; -static PyObject *__pyx_n_s__word; -static PyObject *__pyx_n_s__word_alignments; -static PyObject *__pyx_n_s__word_ids; -static PyObject *__pyx_n_s__words; -static PyObject *__pyx_n_s__write; -static PyObject *__pyx_n_s__write_text; -static PyObject *__pyx_n_s__x; -static PyObject *__pyx_n_s__y; -static PyObject *__pyx_n_s__zip; +static PyObject *__pyx_kp_s_Bucket_sort_took_f_seconds; +static PyObject *__pyx_kp_s_Computing_collocations; +static PyObject *__pyx_kp_s_Computing_inverted_indexes; +static PyObject *__pyx_kp_s_Constructing_LCP_array; +static PyObject *__pyx_kp_s_Converting_d_hash_keys_on_precom; +static PyObject *__pyx_kp_s_Converting_d_hash_keys_on_precom_2; +static PyObject *__pyx_n_s_Counter; +static PyObject *__pyx_kp_s_Didn_t_extract_anything_from_d_d; +static PyObject *__pyx_n_s_END_OF_FILE; +static PyObject *__pyx_n_s_END_OF_LINE; +static PyObject *__pyx_kp_s_ERROR_unexpected_pattern_s_in_se; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_kp_s_Extract_time_f_seconds; +static PyObject *__pyx_n_s_FeatureContext; +static PyObject *__pyx_kp_s_Finalizing_sort; +static PyObject *__pyx_kp_s_Gaps_are_not_tight_phrases; +static PyObject *__pyx_n_s_GzipFile; +static PyObject *__pyx_n_s_INCREMENT; +static PyObject *__pyx_n_s_INITIAL_CAPACITY; +static PyObject *__pyx_kp_s_Illegal_key_type_s_for_IntList; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Inside_edges_of_following_subphr; +static PyObject *__pyx_kp_s_Inside_edges_of_preceding_subphr; +static PyObject *__pyx_kp_s_IntList; +static PyObject *__pyx_kp_s_Intersect_time_f_seconds; +static PyObject *__pyx_kp_s_Invalid_LHS_symbol_d; +static PyObject *__pyx_kp_s_Keyword_trie_error; +static PyObject *__pyx_kp_s_LCP_array_completed; +static PyObject *__pyx_kp_s_Must_specify_an_alignment_object; +static PyObject *__pyx_n_s_NULL; +static PyObject *__pyx_kp_s_No_aligned_terminals; +static PyObject *__pyx_kp_s_No_online_bilexical_dictionary_s; +static PyObject *__pyx_n_s_OnlineFeatureContext; +static PyObject *__pyx_kp_s_Precomputation_done_with_max_ini; +static PyObject *__pyx_kp_s_Precomputation_done_with_max_non; +static PyObject *__pyx_kp_s_Precomputation_done_with_max_ter; +static PyObject *__pyx_kp_s_Precomputation_done_with_min_gap; +static PyObject *__pyx_kp_s_Precomputation_took_f_seconds; +static PyObject *__pyx_kp_s_Precomputed_collocations_for_d_p; +static PyObject *__pyx_kp_s_Precomputed_inverted_index_for_d; +static PyObject *__pyx_kp_s_Precomputing_frequent_intersecti; +static PyObject *__pyx_kp_s_Processing_precomputations_took; +static PyObject *__pyx_kp_s_RANK_d_COUNT_COST_d_d_CUMUL_d_d; +static PyObject *__pyx_n_s_RUSAGE_SELF; +static PyObject *__pyx_kp_s_Reading_precomputed_data_from_fi; +static PyObject *__pyx_kp_s_Refinement_took_f_seconds; +static PyObject *__pyx_kp_s_Refining_sort_depth_d; +static PyObject *__pyx_kp_s_Requested_index_d_d_of_d_length; +static PyObject *__pyx_kp_s_Requested_index_d_of_d_length_Fl; +static PyObject *__pyx_kp_s_Requested_index_d_of_d_length_In; +static PyObject *__pyx_kp_s_Sampling_strategy_no_sampling; +static PyObject *__pyx_kp_s_Sampling_strategy_uniform_max_sa; +static PyObject *__pyx_kp_s_Sort_error_in_CLex; +static PyObject *__pyx_n_s_StopIteration; +static PyObject *__pyx_kp_s_Subphrase_d_d_failed_integrity_c; +static PyObject *__pyx_kp_s_Suffix_array_construction_took_f; +static PyObject *__pyx_kp_s_Total_time_for_rule_lookup_extra; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_extract_basic_phrase; +static PyObject *__pyx_kp_s_Unaligned_chunk; +static PyObject *__pyx_kp_s_Unexpected_condition_found_in_q3; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s_X; +static PyObject *__pyx_kp_s_X_0_1_2; +static PyObject *__pyx_kp_s__10; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__21; +static PyObject *__pyx_kp_s__32; +static PyObject *__pyx_kp_s__34; +static PyObject *__pyx_kp_s__41; +static PyObject *__pyx_kp_s__42; +static PyObject *__pyx_kp_s__45; +static PyObject *__pyx_kp_s__46; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_kp_s__63; +static PyObject *__pyx_kp_s__64; +static PyObject *__pyx_kp_s__65; +static PyObject *__pyx_n_s_a; +static PyObject *__pyx_n_s_add_instance_locals_extract; +static PyObject *__pyx_n_s_advance; +static PyObject *__pyx_n_s_al; +static PyObject *__pyx_n_s_alignment; +static PyObject *__pyx_n_s_alignments; +static PyObject *__pyx_n_s_alphabet_size; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_arity; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_arr_high; +static PyObject *__pyx_n_s_arr_low; +static PyObject *__pyx_n_s_bilex; +static PyObject *__pyx_n_s_by_slack_factor; +static PyObject *__pyx_n_s_category; +static PyObject *__pyx_kp_s_cdec_sa; +static PyObject *__pyx_n_s_cdec_sa__sa; +static PyObject *__pyx_n_s_chain; +static PyObject *__pyx_n_s_children; +static PyObject *__pyx_n_s_cinit___locals_lambda; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_cmp; +static PyObject *__pyx_n_s_col; +static PyObject *__pyx_n_s_collect; +static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_columns; +static PyObject *__pyx_n_s_ctx_name; +static PyObject *__pyx_n_s_curr_idx; +static PyObject *__pyx_kp_s_d; +static PyObject *__pyx_kp_s_d_d; +static PyObject *__pyx_kp_s_d_d_2; +static PyObject *__pyx_kp_s_d_d_out_of_bounds_I_d_J_d_in_li; +static PyObject *__pyx_kp_s_d_f_f; +static PyObject *__pyx_kp_s_d_s; +static PyObject *__pyx_kp_s_d_sentences; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_decode_lattice; +static PyObject *__pyx_n_s_decode_sentence; +static PyObject *__pyx_n_s_decode_words; +static PyObject *__pyx_n_s_defaultdict; +static PyObject *__pyx_n_s_dist; +static PyObject *__pyx_n_s_doquicksort; +static PyObject *__pyx_kp_s_double_binary; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_e_i; +static PyObject *__pyx_n_s_e_j; +static PyObject *__pyx_n_s_e_span; +static PyObject *__pyx_n_s_e_text; +static PyObject *__pyx_n_s_e_words; +static PyObject *__pyx_n_s_earray; +static PyObject *__pyx_n_s_edarray; +static PyObject *__pyx_n_s_encode_words; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_ephrase; +static PyObject *__pyx_n_s_eword; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_extend; +static PyObject *__pyx_n_s_extended; +static PyObject *__pyx_n_s_extract; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_f_i; +static PyObject *__pyx_n_s_f_j; +static PyObject *__pyx_n_s_f_span; +static PyObject *__pyx_n_s_f_text; +static PyObject *__pyx_n_s_f_words; +static PyObject *__pyx_n_s_fcount; +static PyObject *__pyx_n_s_filename; +static PyObject *__pyx_n_s_form_rule; +static PyObject *__pyx_n_s_form_rule_locals_lambda; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fphrase; +static PyObject *__pyx_n_s_from_binary; +static PyObject *__pyx_n_s_from_data; +static PyObject *__pyx_n_s_from_iterable; +static PyObject *__pyx_n_s_from_stats; +static PyObject *__pyx_n_s_from_text; +static PyObject *__pyx_n_s_frontier; +static PyObject *__pyx_n_s_fsample_count; +static PyObject *__pyx_n_s_fsarray; +static PyObject *__pyx_n_s_fword; +static PyObject *__pyx_n_s_fwords; +static PyObject *__pyx_n_s_gc; +static PyObject *__pyx_n_s_genexpr; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_getLogger; +static PyObject *__pyx_n_s_get_all_nodes_isteps_away; +static PyObject *__pyx_n_s_get_e_id; +static PyObject *__pyx_n_s_get_f_id; +static PyObject *__pyx_n_s_get_f_phrases; +static PyObject *__pyx_n_s_get_f_phrases_locals_extract; +static PyObject *__pyx_n_s_get_id; +static PyObject *__pyx_n_s_get_next_states; +static PyObject *__pyx_n_s_get_precomputed_collocation; +static PyObject *__pyx_n_s_get_word; +static PyObject *__pyx_n_s_getchunk; +static PyObject *__pyx_n_s_getrusage; +static PyObject *__pyx_kp_s_gz; +static PyObject *__pyx_n_s_gzip; +static PyObject *__pyx_n_s_gzip_or_text; +static PyObject *__pyx_n_s_h; +static PyObject *__pyx_n_s_high; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_ifrom; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_increment; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_n_s_info; +static PyObject *__pyx_n_s_initial_len; +static PyObject *__pyx_n_s_input_locals_lambda; +static PyObject *__pyx_n_s_input_locals_lambda_locals_lambd; +static PyObject *__pyx_n_s_input_match; +static PyObject *__pyx_n_s_input_span; +static PyObject *__pyx_n_s_insert; +static PyObject *__pyx_n_s_isa; +static PyObject *__pyx_n_s_isvar; +static PyObject *__pyx_n_s_iteritems; +static PyObject *__pyx_n_s_itertools; +static PyObject *__pyx_n_s_itervalues; +static PyObject *__pyx_n_s_ito; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_lattice; +static PyObject *__pyx_kp_s_len; +static PyObject *__pyx_n_s_lex_i; +static PyObject *__pyx_n_s_lex_j; +static PyObject *__pyx_n_s_lhs; +static PyObject *__pyx_n_s_link; +static PyObject *__pyx_n_s_link_i; +static PyObject *__pyx_n_s_link_j; +static PyObject *__pyx_n_s_links; +static PyObject *__pyx_n_s_logger; +static PyObject *__pyx_n_s_logging; +static PyObject *__pyx_n_s_lookup; +static PyObject *__pyx_n_s_low; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_make_lattice; +static PyObject *__pyx_n_s_map; +static PyObject *__pyx_n_s_matches; +static PyObject *__pyx_n_s_max; +static PyObject *__pyx_n_s_max_chunks; +static PyObject *__pyx_n_s_max_initial_size; +static PyObject *__pyx_n_s_max_length; +static PyObject *__pyx_n_s_max_nonterminals; +static PyObject *__pyx_n_s_max_target_chunks; +static PyObject *__pyx_n_s_max_target_length; +static PyObject *__pyx_n_s_merge; +static PyObject *__pyx_n_s_meta; +static PyObject *__pyx_n_s_min_bound; +static PyObject *__pyx_n_s_min_dist; +static PyObject *__pyx_n_s_min_gap_size; +static PyObject *__pyx_n_s_monitor_cpu; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_namedtuple; +static PyObject *__pyx_n_s_new_e_i; +static PyObject *__pyx_n_s_new_e_j; +static PyObject *__pyx_n_s_new_lex_i; +static PyObject *__pyx_n_s_new_lex_j; +static PyObject *__pyx_n_s_new_min_bound; +static PyObject *__pyx_n_s_next_states; +static PyObject *__pyx_n_s_nt; +static PyObject *__pyx_n_s_nt_collision; +static PyObject *__pyx_n_s_nt_open; +static PyObject *__pyx_n_s_ntc; +static PyObject *__pyx_n_s_num_subpatterns; +static PyObject *__pyx_n_s_offset; +static PyObject *__pyx_n_s_old_last_nt; +static PyObject *__pyx_n_s_online; +static PyObject *__pyx_n_s_online_ctx_lookup; +static PyObject *__pyx_n_s_open; +static PyObject *__pyx_n_s_pad; +static PyObject *__pyx_n_s_paircount; +static PyObject *__pyx_n_s_partition; +static PyObject *__pyx_n_s_pathlen; +static PyObject *__pyx_n_s_pattern2phrase; +static PyObject *__pyx_n_s_pattern2phrase_plus; +static PyObject *__pyx_n_s_phrase; +static PyObject *__pyx_n_s_phrase_location; +static PyObject *__pyx_n_s_phrases_al; +static PyObject *__pyx_n_s_phrases_e; +static PyObject *__pyx_n_s_phrases_f; +static PyObject *__pyx_n_s_phrases_fe; +static PyObject *__pyx_n_s_plus_links; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_precompute; +static PyObject *__pyx_n_s_precompute_file; +static PyObject *__pyx_n_s_precompute_rank; +static PyObject *__pyx_n_s_precompute_secondary_rank; +static PyObject *__pyx_n_s_precomputed; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_q3sort; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reachable; +static PyObject *__pyx_n_s_reachable_buffer; +static PyObject *__pyx_n_s_read_binary; +static PyObject *__pyx_n_s_read_bitext; +static PyObject *__pyx_n_s_read_text; +static PyObject *__pyx_n_s_read_text_data; +static PyObject *__pyx_n_s_require_aligned_chunks; +static PyObject *__pyx_n_s_require_aligned_terminal; +static PyObject *__pyx_n_s_res; +static PyObject *__pyx_n_s_reset; +static PyObject *__pyx_n_s_resource; +static PyObject *__pyx_n_s_ru_stime; +static PyObject *__pyx_n_s_ru_utime; +static PyObject *__pyx_kp_s_s; +static PyObject *__pyx_kp_s_s_2; +static PyObject *__pyx_kp_s_s_d; +static PyObject *__pyx_kp_s_s_d_2; +static PyObject *__pyx_kp_s_s_not_in_IntList; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_s_6f_6f; +static PyObject *__pyx_n_s_sa; +static PyObject *__pyx_n_s_sa_high; +static PyObject *__pyx_n_s_sa_low; +static PyObject *__pyx_n_s_sample; +static PyObject *__pyx_n_s_sample_size; +static PyObject *__pyx_n_s_sampler; +static PyObject *__pyx_n_s_samples_f; +static PyObject *__pyx_n_s_sarray; +static PyObject *__pyx_n_s_scorer; +static PyObject *__pyx_n_s_scores; +static PyObject *__pyx_n_s_seek; +static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_set; +static PyObject *__pyx_n_s_shortest; +static PyObject *__pyx_n_s_side; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_skip; +static PyObject *__pyx_n_s_sorted; +static PyObject *__pyx_n_s_source; +static PyObject *__pyx_n_s_span_check; +static PyObject *__pyx_n_s_span_dec; +static PyObject *__pyx_n_s_span_inc; +static PyObject *__pyx_n_s_spanlen; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_stats; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_n_s_suffix_link; +static PyObject *__pyx_n_s_sym; +static PyObject *__pyx_n_s_syms; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_test_sentence; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_tight_phrases; +static PyObject *__pyx_n_s_toMap; +static PyObject *__pyx_n_s_train_max_initial_size; +static PyObject *__pyx_n_s_train_min_gap_size; +static PyObject *__pyx_n_s_unlink; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_s_use_baeza_yates; +static PyObject *__pyx_n_s_use_collocations; +static PyObject *__pyx_n_s_use_index; +static PyObject *__pyx_n_s_use_sent_id; +static PyObject *__pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt; +static PyObject *__pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_2; +static PyObject *__pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_3; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_vec; +static PyObject *__pyx_n_s_w; +static PyObject *__pyx_n_s_warn; +static PyObject *__pyx_n_s_warning; +static PyObject *__pyx_n_s_wc; +static PyObject *__pyx_n_s_word; +static PyObject *__pyx_n_s_word_alignments; +static PyObject *__pyx_n_s_word_ids; +static PyObject *__pyx_n_s_words; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_write_enhanced_handle; +static PyObject *__pyx_n_s_write_text; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_n_s_zip; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_5; static PyObject *__pyx_int_7; -static PyObject *__pyx_int_neg_1; static PyObject *__pyx_int_10; static PyObject *__pyx_int_20; static PyObject *__pyx_int_1000; -static PyObject *__pyx_k_43; -static PyObject *__pyx_k_103; -static PyObject *__pyx_k_slice_22; -static PyObject *__pyx_k_tuple_11; -static PyObject *__pyx_k_tuple_12; -static PyObject *__pyx_k_tuple_13; -static PyObject *__pyx_k_tuple_16; -static PyObject *__pyx_k_tuple_17; -static PyObject *__pyx_k_tuple_18; -static PyObject *__pyx_k_tuple_20; -static PyObject *__pyx_k_tuple_21; -static PyObject *__pyx_k_tuple_24; -static PyObject *__pyx_k_tuple_25; -static PyObject *__pyx_k_tuple_26; -static PyObject *__pyx_k_tuple_28; -static PyObject *__pyx_k_tuple_30; -static PyObject *__pyx_k_tuple_31; -static PyObject *__pyx_k_tuple_32; -static PyObject *__pyx_k_tuple_34; -static PyObject *__pyx_k_tuple_35; -static PyObject *__pyx_k_tuple_36; -static PyObject *__pyx_k_tuple_38; -static PyObject *__pyx_k_tuple_39; -static PyObject *__pyx_k_tuple_40; -static PyObject *__pyx_k_tuple_41; -static PyObject *__pyx_k_tuple_42; -static PyObject *__pyx_k_tuple_45; -static PyObject *__pyx_k_tuple_46; -static PyObject *__pyx_k_tuple_49; -static PyObject *__pyx_k_tuple_51; -static PyObject *__pyx_k_tuple_53; -static PyObject *__pyx_k_tuple_55; -static PyObject *__pyx_k_tuple_56; -static PyObject *__pyx_k_tuple_57; -static PyObject *__pyx_k_tuple_59; -static PyObject *__pyx_k_tuple_63; -static PyObject *__pyx_k_tuple_65; -static PyObject *__pyx_k_tuple_75; -static PyObject *__pyx_k_tuple_77; -static PyObject *__pyx_k_tuple_79; -static PyObject *__pyx_k_tuple_81; -static PyObject *__pyx_k_tuple_82; -static PyObject *__pyx_k_tuple_83; -static PyObject *__pyx_k_tuple_84; -static PyObject *__pyx_k_tuple_95; -static PyObject *__pyx_k_tuple_98; -static PyObject *__pyx_k_tuple_99; -static PyObject *__pyx_k_slice_141; -static PyObject *__pyx_k_slice_146; -static PyObject *__pyx_k_slice_148; -static PyObject *__pyx_k_slice_149; -static PyObject *__pyx_k_tuple_100; -static PyObject *__pyx_k_tuple_106; -static PyObject *__pyx_k_tuple_111; -static PyObject *__pyx_k_tuple_127; -static PyObject *__pyx_k_tuple_142; -static PyObject *__pyx_k_tuple_153; -static PyObject *__pyx_k_tuple_159; -static PyObject *__pyx_k_tuple_162; -static PyObject *__pyx_k_tuple_163; -static PyObject *__pyx_k_tuple_166; -static PyObject *__pyx_k_tuple_168; -static PyObject *__pyx_k_tuple_170; -static PyObject *__pyx_k_tuple_172; -static PyObject *__pyx_k_tuple_174; -static PyObject *__pyx_k_tuple_177; -static PyObject *__pyx_k_tuple_179; -static PyObject *__pyx_k_tuple_181; -static PyObject *__pyx_k_codeobj_143; -static PyObject *__pyx_k_codeobj_154; -static PyObject *__pyx_k_codeobj_157; -static PyObject *__pyx_k_codeobj_160; -static PyObject *__pyx_k_codeobj_164; -static PyObject *__pyx_k_codeobj_167; -static PyObject *__pyx_k_codeobj_169; -static PyObject *__pyx_k_codeobj_171; -static PyObject *__pyx_k_codeobj_173; -static PyObject *__pyx_k_codeobj_175; -static PyObject *__pyx_k_codeobj_178; -static PyObject *__pyx_k_codeobj_180; -static PyObject *__pyx_k_codeobj_182; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__13; +static PyObject *__pyx_slice__67; +static PyObject *__pyx_slice__70; +static PyObject *__pyx_slice__72; +static PyObject *__pyx_slice__73; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__74; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_codeobj__69; +static PyObject *__pyx_codeobj__75; +static PyObject *__pyx_codeobj__76; +static PyObject *__pyx_codeobj__78; +static PyObject *__pyx_codeobj__81; +static PyObject *__pyx_codeobj__83; +static PyObject *__pyx_codeobj__85; +static PyObject *__pyx_codeobj__87; +static PyObject *__pyx_codeobj__89; +static PyObject *__pyx_codeobj__91; +static PyObject *__pyx_codeobj__93; +static PyObject *__pyx_codeobj__95; +static PyObject *__pyx_codeobj__97; + +/* "cdec/sa/_sa.pyx":5 + * import gzip + * + * def monitor_cpu(): # <<<<<<<<<<<<<< + * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ + * resource.getrusage(resource.RUSAGE_SELF).ru_stime) + */ /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_1monitor_cpu(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ @@ -3715,18 +3852,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_1monitor_cpu(PyObject *__pyx_self, CYTH __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitor_cpu (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_monitor_cpu(__pyx_self); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "cdec/sa/_sa.pyx":5 - * import gzip - * - * def monitor_cpu(): # <<<<<<<<<<<<<< - * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ - * resource.getrusage(resource.RUSAGE_SELF).ru_stime) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_monitor_cpu(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -3747,14 +3878,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_monitor_cpu(CYTHON_UNUSED PyObject *__p * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__resource); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_resource); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__getrusage); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getrusage); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__resource); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_resource); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__RUSAGE_SELF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_RUSAGE_SELF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3762,11 +3893,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_monitor_cpu(CYTHON_UNUSED PyObject *__p PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__ru_utime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ru_utime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3777,14 +3908,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_monitor_cpu(CYTHON_UNUSED PyObject *__p * * def gzip_or_text(char* filename): */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__resource); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_resource); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__getrusage); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getrusage); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__resource); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_resource); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__RUSAGE_SELF); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RUSAGE_SELF); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3792,13 +3923,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_monitor_cpu(CYTHON_UNUSED PyObject *__p PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __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 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__ru_stime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ru_stime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cdec/sa/_sa.pyx":6 + * + * def monitor_cpu(): + * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ # <<<<<<<<<<<<<< + * resource.getrusage(resource.RUSAGE_SELF).ru_stime) + * + */ __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3807,8 +3946,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_monitor_cpu(CYTHON_UNUSED PyObject *__p __pyx_t_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "cdec/sa/_sa.pyx":5 + * import gzip + * + * def monitor_cpu(): # <<<<<<<<<<<<<< + * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ + * resource.getrusage(resource.RUSAGE_SELF).ru_stime) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -3822,6 +3968,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_monitor_cpu(CYTHON_UNUSED PyObject *__p return __pyx_r; } +/* "cdec/sa/_sa.pyx":9 + * resource.getrusage(resource.RUSAGE_SELF).ru_stime) + * + * def gzip_or_text(char* filename): # <<<<<<<<<<<<<< + * if filename.endswith('.gz'): + * return gzip.GzipFile(filename) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3gzip_or_text(PyObject *__pyx_self, PyObject *__pyx_arg_filename); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_3gzip_or_text = {__Pyx_NAMESTR("gzip_or_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_3gzip_or_text, METH_O, __Pyx_DOCSTR(0)}; @@ -3843,18 +3997,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3gzip_or_text(PyObject *__pyx_self, PyO return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_2gzip_or_text(__pyx_self, ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "cdec/sa/_sa.pyx":9 - * resource.getrusage(resource.RUSAGE_SELF).ru_stime) - * - * def gzip_or_text(char* filename): # <<<<<<<<<<<<<< - * if filename.endswith('.gz'): - * return gzip.GzipFile(filename) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_2gzip_or_text(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_filename) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -3875,9 +4023,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_2gzip_or_text(CYTHON_UNUSED PyObject *_ * else: */ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = __Pyx_PyBytes_Tailmatch(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_kp_s_1), 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBytes_Tailmatch(__pyx_t_1, __pyx_kp_s_gz, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((__pyx_t_2 != 0)) { /* "cdec/sa/_sa.pyx":11 @@ -3888,26 +4036,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_2gzip_or_text(CYTHON_UNUSED PyObject *_ * return open(filename) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__gzip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gzip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__GzipFile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_GzipFile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - goto __pyx_L3; } /*else*/ { @@ -3920,23 +4067,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_2gzip_or_text(CYTHON_UNUSED PyObject *_ */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } - __pyx_L3:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "cdec/sa/_sa.pyx":9 + * resource.getrusage(resource.RUSAGE_SELF).ru_stime) + * + * def gzip_or_text(char* filename): # <<<<<<<<<<<<<< + * if filename.endswith('.gz'): + * return gzip.GzipFile(filename) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); @@ -3949,6 +4102,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_2gzip_or_text(CYTHON_UNUSED PyObject *_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":11 + * cdef class FloatList: + * + * def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<< + * if initial_len > size: + * size = initial_len + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -3962,7 +4123,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, __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}; + 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; @@ -3978,17 +4139,17 @@ static int __pyx_pw_4cdec_2sa_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__increment); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_increment); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__initial_len); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_initial_len); if (value) { values[2] = value; kw_args--; } } } @@ -4005,17 +4166,17 @@ static int __pyx_pw_4cdec_2sa_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, } } if (values[0]) { - __pyx_v_size = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_size = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_size = ((int)0); } if (values[1]) { - __pyx_v_increment = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_increment == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_increment = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_increment == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_increment = ((int)1); } if (values[2]) { - __pyx_v_initial_len = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_initial_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_initial_len = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_initial_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_initial_len = ((int)0); } @@ -4029,25 +4190,19 @@ static int __pyx_pw_4cdec_2sa_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_v_self), __pyx_v_size, __pyx_v_increment, __pyx_v_initial_len); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":11 - * cdef class FloatList: - * - * def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<< - * if initial_len > size: - * size = initial_len - */ - static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2sa_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; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":12 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":12 * * def __cinit__(self, int size=0, int increment=1, int initial_len=0): * if initial_len > size: # <<<<<<<<<<<<<< @@ -4057,7 +4212,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2 __pyx_t_1 = ((__pyx_v_initial_len > __pyx_v_size) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":13 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":13 * def __cinit__(self, int size=0, int increment=1, int initial_len=0): * if initial_len > size: * size = initial_len # <<<<<<<<<<<<<< @@ -4069,7 +4224,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2 } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":14 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":14 * if initial_len > size: * size = initial_len * self.size = size # <<<<<<<<<<<<<< @@ -4078,7 +4233,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2 */ __pyx_v_self->size = __pyx_v_size; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":15 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":15 * size = initial_len * self.size = size * self.increment = increment # <<<<<<<<<<<<<< @@ -4087,7 +4242,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2 */ __pyx_v_self->increment = __pyx_v_increment; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":16 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":16 * self.size = size * self.increment = increment * self.len = initial_len # <<<<<<<<<<<<<< @@ -4096,7 +4251,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2 */ __pyx_v_self->len = __pyx_v_initial_len; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":17 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":17 * self.increment = increment * self.len = initial_len * self.arr = malloc(size*sizeof(float)) # <<<<<<<<<<<<<< @@ -4105,7 +4260,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2 */ __pyx_v_self->arr = ((float *)malloc((__pyx_v_size * (sizeof(float))))); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":18 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":18 * self.len = initial_len * self.arr = malloc(size*sizeof(float)) * memset(self.arr, 0, initial_len*sizeof(float)) # <<<<<<<<<<<<<< @@ -4114,33 +4269,44 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2 */ memset(__pyx_v_self->arr, 0, (__pyx_v_initial_len * (sizeof(float)))); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":11 + * cdef class FloatList: + * + * def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<< + * if initial_len > size: + * size = initial_len + */ + + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":20 + * memset(self.arr, 0, initial_len*sizeof(float)) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.arr) + * + */ + /* Python wrapper */ static void __pyx_pw_4cdec_2sa_3_sa_9FloatList_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4cdec_2sa_3_sa_9FloatList_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_4cdec_2sa_3_sa_9FloatList_2__dealloc__(((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":20 - * memset(self.arr, 0, initial_len*sizeof(float)) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self.arr) - * - */ - static void __pyx_pf_4cdec_2sa_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":21 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":21 * * def __dealloc__(self): * free(self.arr) # <<<<<<<<<<<<<< @@ -4149,9 +4315,26 @@ static void __pyx_pf_4cdec_2sa_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_4cd */ free(__pyx_v_self->arr); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":20 + * memset(self.arr, 0, initial_len*sizeof(float)) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.arr) + * + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":23 + * free(self.arr) + * + * def __getitem__(self, i): # <<<<<<<<<<<<<< + * j = i + * if i<0: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -4159,18 +4342,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_5__getitem__(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":23 - * free(self.arr) - * - * def __getitem__(self, i): # <<<<<<<<<<<<<< - * j = i - * if i<0: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_v_j = NULL; PyObject *__pyx_r = NULL; @@ -4186,7 +4363,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":24 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":24 * * def __getitem__(self, i): * j = i # <<<<<<<<<<<<<< @@ -4196,7 +4373,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob __Pyx_INCREF(__pyx_v_i); __pyx_v_j = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":25 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":25 * def __getitem__(self, i): * j = i * if i<0: # <<<<<<<<<<<<<< @@ -4208,14 +4385,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":26 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":26 * j = i * if i<0: * j = self.len + i # <<<<<<<<<<<<<< * if j<0 or j>=self.len: * raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len)) */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -4226,7 +4403,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":27 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":27 * if i<0: * j = self.len + i * if j<0 or j>=self.len: # <<<<<<<<<<<<<< @@ -4237,7 +4414,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_2) { - __pyx_t_3 = PyInt_FromLong(__pyx_v_self->len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_v_j, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4249,14 +4426,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":28 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":28 * j = self.len + i * if j<0 or j>=self.len: * raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len)) # <<<<<<<<<<<<<< * return self.arr[j] * */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -4266,25 +4443,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Requested_index_d_of_d_length_Fl, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __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[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + 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_builtin_IndexError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":29 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":29 * if j<0 or j>=self.len: * raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len)) * return self.arr[j] # <<<<<<<<<<<<<< @@ -4299,8 +4474,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob __pyx_t_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":23 + * free(self.arr) + * + * def __getitem__(self, i): # <<<<<<<<<<<<<< + * j = i + * if i<0: + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); @@ -4313,7 +4495,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":31 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":31 * return self.arr[j] * * cdef void set(self, int i, float v): # <<<<<<<<<<<<<< @@ -4335,7 +4517,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":32 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":32 * * cdef void set(self, int i, float v): * j = i # <<<<<<<<<<<<<< @@ -4344,7 +4526,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s */ __pyx_v_j = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":33 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":33 * cdef void set(self, int i, float v): * j = i * if i<0: # <<<<<<<<<<<<<< @@ -4354,7 +4536,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s __pyx_t_1 = ((__pyx_v_i < 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":34 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":34 * j = i * if i<0: * j = self.len + i # <<<<<<<<<<<<<< @@ -4366,7 +4548,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":35 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":35 * if i<0: * j = self.len + i * if j<0 or j>=self.len: # <<<<<<<<<<<<<< @@ -4382,16 +4564,16 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":36 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":36 * j = self.len + i * if j<0 or j>=self.len: * raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len)) # <<<<<<<<<<<<<< * self.arr[j] = v * */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyInt_FromLong(__pyx_v_self->len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __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[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); @@ -4401,25 +4583,23 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s __Pyx_GIVEREF(__pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Requested_index_d_of_d_length_Fl, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":37 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":37 * if j<0 or j>=self.len: * raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len)) * self.arr[j] = v # <<<<<<<<<<<<<< @@ -4428,16 +4608,33 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s */ (__pyx_v_self->arr[__pyx_v_j]) = __pyx_v_v; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":31 + * return self.arr[j] + * + * cdef void set(self, int i, float v): # <<<<<<<<<<<<<< + * j = i + * if i<0: + */ + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("cdec.sa._sa.FloatList.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.FloatList.set", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":39 + * self.arr[j] = v + * + * def __setitem__(self, i, val): # <<<<<<<<<<<<<< + * self.set(i, val) + * + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_9FloatList_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_9FloatList_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { @@ -4445,18 +4642,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_9FloatList_7__setitem__(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9FloatList_6__setitem__(((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_v_self), ((PyObject *)__pyx_v_i), ((PyObject *)__pyx_v_val)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":39 - * self.arr[j] = v - * - * def __setitem__(self, i, val): # <<<<<<<<<<<<<< - * self.set(i, val) - * - */ - static int __pyx_pf_4cdec_2sa_3_sa_9FloatList_6__setitem__(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations @@ -4467,17 +4658,26 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList_6__setitem__(struct __pyx_obj_4cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":40 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":40 * * def __setitem__(self, i, val): * self.set(i, val) # <<<<<<<<<<<<<< * * def __len__(self): */ - __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 = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __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 = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->set(__pyx_v_self, __pyx_t_1, __pyx_t_2); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":39 + * self.arr[j] = v + * + * def __setitem__(self, i, val): # <<<<<<<<<<<<<< + * self.set(i, val) + * + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -4488,6 +4688,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList_6__setitem__(struct __pyx_obj_4cde return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":42 + * self.set(i, val) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.len + * + */ + /* Python wrapper */ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_9FloatList_9__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_9FloatList_9__len__(PyObject *__pyx_v_self) { @@ -4495,24 +4703,18 @@ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_9FloatList_9__len__(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9FloatList_8__len__(((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":42 - * self.set(i, val) - * - * def __len__(self): # <<<<<<<<<<<<<< - * return self.len - * - */ - static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9FloatList_8__len__(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":43 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":43 * * def __len__(self): * return self.len # <<<<<<<<<<<<<< @@ -4522,12 +4724,28 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9FloatList_8__len__(struct __pyx_obj_4 __pyx_r = __pyx_v_self->len; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":42 + * self.set(i, val) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.len + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":45 + * return self.len + * + * def append(self, float val): # <<<<<<<<<<<<<< + * if self.len == self.size: + * self.size = self.size + self.increment + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_11append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_11append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { @@ -4548,25 +4766,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_11append(PyObject *__pyx_v_s return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_v_self), ((float)__pyx_v_val)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":45 - * return self.len - * - * def append(self, float val): # <<<<<<<<<<<<<< - * if self.len == self.size: - * self.size = self.size + self.increment - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *__pyx_v_self, float __pyx_v_val) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("append", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":46 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":46 * * def append(self, float val): * if self.len == self.size: # <<<<<<<<<<<<<< @@ -4576,7 +4788,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c __pyx_t_1 = ((__pyx_v_self->len == __pyx_v_self->size) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":47 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":47 * def append(self, float val): * if self.len == self.size: * self.size = self.size + self.increment # <<<<<<<<<<<<<< @@ -4585,7 +4797,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c */ __pyx_v_self->size = (__pyx_v_self->size + __pyx_v_self->increment); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":48 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":48 * if self.len == self.size: * self.size = self.size + self.increment * self.arr = realloc(self.arr, self.size*sizeof(float)) # <<<<<<<<<<<<<< @@ -4597,7 +4809,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":49 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":49 * self.size = self.size + self.increment * self.arr = realloc(self.arr, self.size*sizeof(float)) * self.arr[self.len] = val # <<<<<<<<<<<<<< @@ -4606,7 +4818,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c */ (__pyx_v_self->arr[__pyx_v_self->len]) = __pyx_v_val; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":50 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":50 * self.arr = realloc(self.arr, self.size*sizeof(float)) * self.arr[self.len] = val * self.len = self.len + 1 # <<<<<<<<<<<<<< @@ -4615,13 +4827,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c */ __pyx_v_self->len = (__pyx_v_self->len + 1); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":45 + * return self.len + * + * def append(self, float val): # <<<<<<<<<<<<<< + * if self.len == self.size: + * self.size = self.size + self.increment + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":52 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":52 * self.len = self.len + 1 * * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -4633,7 +4854,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_write_handle(struct __pyx_obj_4cde __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_handle", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":53 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":53 * * cdef void write_handle(self, FILE* f): * fwrite(&(self.len), sizeof(float), 1, f) # <<<<<<<<<<<<<< @@ -4642,7 +4863,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_write_handle(struct __pyx_obj_4cde */ fwrite((&__pyx_v_self->len), (sizeof(float)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":54 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":54 * cdef void write_handle(self, FILE* f): * fwrite(&(self.len), sizeof(float), 1, f) * fwrite(self.arr, sizeof(float), self.len, f) # <<<<<<<<<<<<<< @@ -4651,9 +4872,26 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_write_handle(struct __pyx_obj_4cde */ fwrite(__pyx_v_self->arr, (sizeof(float)), __pyx_v_self->len, __pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":52 + * self.len = self.len + 1 + * + * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< + * fwrite(&(self.len), sizeof(float), 1, f) + * fwrite(self.arr, sizeof(float), self.len, f) + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":56 + * fwrite(self.arr, sizeof(float), self.len, f) + * + * def write(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_13write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_13write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -4674,34 +4912,28 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_13write(PyObject *__pyx_v_se return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9FloatList_12write(((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":56 - * fwrite(self.arr, sizeof(float), self.len, f) - * - * def write(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "w") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_12write(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":58 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":58 * def write(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< * self.write_handle(f) * fclose(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":59 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":59 * cdef FILE* f * f = fopen(filename, "w") * self.write_handle(f) # <<<<<<<<<<<<<< @@ -4710,7 +4942,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_12write(struct __pyx_obj_4cd */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":60 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":60 * f = fopen(filename, "w") * self.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -4719,13 +4951,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_12write(struct __pyx_obj_4cd */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":56 + * fwrite(self.arr, sizeof(float), self.len, f) + * + * def write(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":62 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":62 * fclose(f) * * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -4738,7 +4979,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec int __pyx_t_1; __Pyx_RefNannySetupContext("read_handle", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":63 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":63 * * cdef void read_handle(self, FILE* f): * free(self.arr) # <<<<<<<<<<<<<< @@ -4747,7 +4988,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec */ free(__pyx_v_self->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":64 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":64 * cdef void read_handle(self, FILE* f): * free(self.arr) * fread(&(self.len), sizeof(float), 1, f) # <<<<<<<<<<<<<< @@ -4756,7 +4997,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec */ fread((&__pyx_v_self->len), (sizeof(float)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":65 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":65 * free(self.arr) * fread(&(self.len), sizeof(float), 1, f) * self.arr = malloc(self.len * sizeof(float)) # <<<<<<<<<<<<<< @@ -4765,7 +5006,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec */ __pyx_v_self->arr = ((float *)malloc((__pyx_v_self->len * (sizeof(float))))); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":66 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":66 * fread(&(self.len), sizeof(float), 1, f) * self.arr = malloc(self.len * sizeof(float)) * self.size = self.len # <<<<<<<<<<<<<< @@ -4775,7 +5016,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec __pyx_t_1 = __pyx_v_self->len; __pyx_v_self->size = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":67 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":67 * self.arr = malloc(self.len * sizeof(float)) * self.size = self.len * fread(self.arr, sizeof(float), self.len, f) # <<<<<<<<<<<<<< @@ -4784,9 +5025,26 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec */ fread(__pyx_v_self->arr, (sizeof(float)), __pyx_v_self->len, __pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":62 + * fclose(f) + * + * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< + * free(self.arr) + * fread(&(self.len), sizeof(float), 1, f) + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":69 + * fread(self.arr, sizeof(float), self.len, f) + * + * def read(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_15read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_15read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -4807,34 +5065,28 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9FloatList_15read(PyObject *__pyx_v_sel return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9FloatList_14read(((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":69 - * fread(self.arr, sizeof(float), self.len, f) - * - * def read(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "r") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_14read(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":71 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":71 * def read(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< * self.read_handle(f) * fclose(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":72 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":72 * cdef FILE* f * f = fopen(filename, "r") * self.read_handle(f) # <<<<<<<<<<<<<< @@ -4842,19 +5094,36 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_14read(struct __pyx_obj_4cde */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/float_list.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":73 * f = fopen(filename, "r") * self.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/float_list.pxi":69 + * fread(self.arr, sizeof(float), self.len, f) + * + * def read(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":11 + * cdef class IntList: + * + * def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<< + * if initial_len > size: + * size = initial_len + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -4868,7 +5137,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, P __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}; + 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; @@ -4884,17 +5153,17 @@ static int __pyx_pw_4cdec_2sa_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, P switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__increment); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_increment); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__initial_len); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_initial_len); if (value) { values[2] = value; kw_args--; } } } @@ -4911,17 +5180,17 @@ static int __pyx_pw_4cdec_2sa_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, P } } if (values[0]) { - __pyx_v_size = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_size = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_size = ((int)0); } if (values[1]) { - __pyx_v_increment = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_increment == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_increment = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_increment == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_increment = ((int)1); } if (values[2]) { - __pyx_v_initial_len = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_initial_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_initial_len = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_initial_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_initial_len = ((int)0); } @@ -4935,25 +5204,19 @@ static int __pyx_pw_4cdec_2sa_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, P return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self), __pyx_v_size, __pyx_v_increment, __pyx_v_initial_len); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":11 - * cdef class IntList: - * - * def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<< - * if initial_len > size: - * size = initial_len - */ - static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa_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; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":12 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":12 * * def __cinit__(self, int size=0, int increment=1, int initial_len=0): * if initial_len > size: # <<<<<<<<<<<<<< @@ -4963,7 +5226,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa __pyx_t_1 = ((__pyx_v_initial_len > __pyx_v_size) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":13 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":13 * def __cinit__(self, int size=0, int increment=1, int initial_len=0): * if initial_len > size: * size = initial_len # <<<<<<<<<<<<<< @@ -4975,7 +5238,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":14 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":14 * if initial_len > size: * size = initial_len * self.size = size # <<<<<<<<<<<<<< @@ -4984,7 +5247,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa */ __pyx_v_self->size = __pyx_v_size; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":15 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":15 * size = initial_len * self.size = size * self.increment = increment # <<<<<<<<<<<<<< @@ -4993,7 +5256,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa */ __pyx_v_self->increment = __pyx_v_increment; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":16 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":16 * self.size = size * self.increment = increment * self.len = initial_len # <<<<<<<<<<<<<< @@ -5002,7 +5265,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa */ __pyx_v_self->len = __pyx_v_initial_len; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":17 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":17 * self.increment = increment * self.len = initial_len * self.arr = malloc(size*sizeof(int)) # <<<<<<<<<<<<<< @@ -5011,7 +5274,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa */ __pyx_v_self->arr = ((int *)malloc((__pyx_v_size * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":18 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":18 * self.len = initial_len * self.arr = malloc(size*sizeof(int)) * memset(self.arr, 0, initial_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -5020,11 +5283,28 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa */ memset(__pyx_v_self->arr, 0, (__pyx_v_initial_len * (sizeof(int)))); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":11 + * cdef class IntList: + * + * def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<< + * if initial_len > size: + * size = initial_len + */ + + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":20 + * memset(self.arr, 0, initial_len*sizeof(int)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * cdef unsigned i + * ret = "IntList[" + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_3__str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_3__str__(PyObject *__pyx_v_self) { @@ -5032,18 +5312,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_3__str__(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":20 - * memset(self.arr, 0, initial_len*sizeof(int)) - * - * def __str__(self): # <<<<<<<<<<<<<< - * cdef unsigned i - * ret = "IntList[" - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self) { PyObject *__pyx_v_ret = NULL; int __pyx_v_idx; @@ -5059,17 +5333,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":22 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":22 * def __str__(self): * cdef unsigned i * ret = "IntList[" # <<<<<<<<<<<<<< * for idx in range(self.size): * if idx>0: */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - __pyx_v_ret = ((PyObject *)__pyx_kp_s_3); + __Pyx_INCREF(__pyx_kp_s_IntList); + __pyx_v_ret = __pyx_kp_s_IntList; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":23 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":23 * cdef unsigned i * ret = "IntList[" * for idx in range(self.size): # <<<<<<<<<<<<<< @@ -5080,7 +5354,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_idx = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":24 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":24 * ret = "IntList[" * for idx in range(self.size): * if idx>0: # <<<<<<<<<<<<<< @@ -5090,14 +5364,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde __pyx_t_3 = ((__pyx_v_idx > 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":25 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":25 * for idx in range(self.size): * if idx>0: * ret += "," # <<<<<<<<<<<<<< * ret += str(self.arr[idx]) * ret += "]" */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_ret, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_ret, __pyx_kp_s_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_4); __pyx_t_4 = 0; @@ -5105,23 +5379,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":26 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":26 * if idx>0: * ret += "," * ret += str(self.arr[idx]) # <<<<<<<<<<<<<< * ret += "]" * ret += "len=" */ - __pyx_t_4 = PyInt_FromLong((__pyx_v_self->arr[__pyx_v_idx])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->arr[__pyx_v_idx])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_ret, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5129,54 +5403,54 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde __pyx_t_5 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":27 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":27 * ret += "," * ret += str(self.arr[idx]) * ret += "]" # <<<<<<<<<<<<<< * ret += "len=" * ret += str(self.len) */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_ret, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_ret, __pyx_kp_s__2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":28 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":28 * ret += str(self.arr[idx]) * ret += "]" * ret += "len=" # <<<<<<<<<<<<<< * ret += str(self.len) * return ret */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_ret, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_ret, __pyx_kp_s_len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":29 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":29 * ret += "]" * ret += "len=" * ret += str(self.len) # <<<<<<<<<<<<<< * return ret * */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_self->len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __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[2]; __pyx_lineno = 29; __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(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __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_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_ret, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":30 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":30 * ret += "len=" * ret += str(self.len) * return ret # <<<<<<<<<<<<<< @@ -5188,8 +5462,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde __pyx_r = __pyx_v_ret; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":20 + * memset(self.arr, 0, initial_len*sizeof(int)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * cdef unsigned i + * ret = "IntList[" + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -5202,6 +5483,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":32 + * return ret + * + * def index(self, int val): # <<<<<<<<<<<<<< + * cdef unsigned i + * for i in range(self.len): + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_5index(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_5index(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { @@ -5213,7 +5502,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_5index(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("index (wrapper)", 0); assert(__pyx_arg_val); { - __pyx_v_val = __Pyx_PyInt_AsInt(__pyx_arg_val); if (unlikely((__pyx_v_val == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_val = __Pyx_PyInt_As_int(__pyx_arg_val); if (unlikely((__pyx_v_val == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5222,18 +5511,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_5index(PyObject *__pyx_v_self, return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_4index(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self), ((int)__pyx_v_val)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":32 - * return ret - * - * def index(self, int val): # <<<<<<<<<<<<<< - * cdef unsigned i - * for i in range(self.len): - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self, int __pyx_v_val) { unsigned int __pyx_v_i; PyObject *__pyx_r = NULL; @@ -5248,7 +5531,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("index", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":34 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":34 * def index(self, int val): * cdef unsigned i * for i in range(self.len): # <<<<<<<<<<<<<< @@ -5259,7 +5542,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":35 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":35 * cdef unsigned i * for i in range(self.len): * if self.arr[i] == val: # <<<<<<<<<<<<<< @@ -5269,7 +5552,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_ __pyx_t_3 = (((__pyx_v_self->arr[__pyx_v_i]) == __pyx_v_val) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":36 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":36 * for i in range(self.len): * if self.arr[i] == val: * return i # <<<<<<<<<<<<<< @@ -5277,42 +5560,47 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - goto __pyx_L5; } - __pyx_L5:; } - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":37 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":37 * if self.arr[i] == val: * return i * raise ValueError('%s not in IntList' % val) # <<<<<<<<<<<<<< * * def partition(self,start,end): */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_val); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_val); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_not_in_IntList, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + 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_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __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_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":32 + * return ret + * + * def index(self, int val): # <<<<<<<<<<<<<< + * cdef unsigned i + * for i in range(self.len): + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -5324,6 +5612,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":39 + * raise ValueError('%s not in IntList' % val) + * + * def partition(self,start,end): # <<<<<<<<<<<<<< + * pivot = self.arr[end] + * bottom = start-1 + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -5336,7 +5632,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_7partition(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("partition (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,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; @@ -5350,10 +5646,10 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_7partition(PyObject *__pyx_v_s kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end)) != 0)) 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 = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -5379,18 +5675,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_7partition(PyObject *__pyx_v_s return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self), __pyx_v_start, __pyx_v_end); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":39 - * raise ValueError('%s not in IntList' % val) - * - * def partition(self,start,end): # <<<<<<<<<<<<<< - * pivot = self.arr[end] - * bottom = start-1 - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end) { PyObject *__pyx_v_pivot = NULL; PyObject *__pyx_v_bottom = NULL; @@ -5409,7 +5699,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c int __pyx_clineno = 0; __Pyx_RefNannySetupContext("partition", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":40 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":40 * * def partition(self,start,end): * pivot = self.arr[end] # <<<<<<<<<<<<<< @@ -5417,12 +5707,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c * top = end */ __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_end); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong((__pyx_v_self->arr[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->arr[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_pivot = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":41 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":41 * def partition(self,start,end): * pivot = self.arr[end] * bottom = start-1 # <<<<<<<<<<<<<< @@ -5434,7 +5724,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __pyx_v_bottom = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":42 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":42 * pivot = self.arr[end] * bottom = start-1 * top = end # <<<<<<<<<<<<<< @@ -5444,7 +5734,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __Pyx_INCREF(__pyx_v_end); __pyx_v_top = __pyx_v_end; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":43 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":43 * bottom = start-1 * top = end * done = 0 # <<<<<<<<<<<<<< @@ -5453,7 +5743,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c */ __pyx_v_done = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":44 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":44 * top = end * done = 0 * while not done: # <<<<<<<<<<<<<< @@ -5464,7 +5754,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __pyx_t_3 = ((!(__pyx_v_done != 0)) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":45 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":45 * done = 0 * while not done: * while not done: # <<<<<<<<<<<<<< @@ -5475,7 +5765,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __pyx_t_3 = ((!(__pyx_v_done != 0)) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":46 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":46 * while not done: * while not done: * bottom += 1 # <<<<<<<<<<<<<< @@ -5487,7 +5777,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __Pyx_DECREF_SET(__pyx_v_bottom, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":47 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":47 * while not done: * bottom += 1 * if bottom == top: # <<<<<<<<<<<<<< @@ -5499,7 +5789,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":48 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":48 * bottom += 1 * if bottom == top: * done = 1 # <<<<<<<<<<<<<< @@ -5508,7 +5798,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c */ __pyx_v_done = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":49 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":49 * if bottom == top: * done = 1 * break # <<<<<<<<<<<<<< @@ -5516,11 +5806,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c * self.arr[top] = self.arr[bottom] */ goto __pyx_L6_break; - goto __pyx_L7; } - __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":50 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":50 * done = 1 * break * if self.arr[bottom] > pivot: # <<<<<<<<<<<<<< @@ -5528,7 +5816,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c * break */ __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_bottom); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong((__pyx_v_self->arr[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->arr[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_pivot, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5536,7 +5824,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":51 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":51 * break * if self.arr[bottom] > pivot: * self.arr[top] = self.arr[bottom] # <<<<<<<<<<<<<< @@ -5547,7 +5835,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_top); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_self->arr[__pyx_t_5]) = (__pyx_v_self->arr[__pyx_t_1]); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":52 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":52 * if self.arr[bottom] > pivot: * self.arr[top] = self.arr[bottom] * break # <<<<<<<<<<<<<< @@ -5555,13 +5843,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c * top -= 1 */ goto __pyx_L6_break; - goto __pyx_L8; } - __pyx_L8:; } __pyx_L6_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":53 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":53 * self.arr[top] = self.arr[bottom] * break * while not done: # <<<<<<<<<<<<<< @@ -5572,7 +5858,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __pyx_t_3 = ((!(__pyx_v_done != 0)) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":54 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":54 * break * while not done: * top -= 1 # <<<<<<<<<<<<<< @@ -5584,7 +5870,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __Pyx_DECREF_SET(__pyx_v_top, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":55 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":55 * while not done: * top -= 1 * if top == bottom: # <<<<<<<<<<<<<< @@ -5596,7 +5882,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":56 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":56 * top -= 1 * if top == bottom: * done = 1 # <<<<<<<<<<<<<< @@ -5605,7 +5891,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c */ __pyx_v_done = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":57 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":57 * if top == bottom: * done = 1 * break # <<<<<<<<<<<<<< @@ -5613,11 +5899,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c * self.arr[bottom] = self.arr[top] */ goto __pyx_L10_break; - goto __pyx_L11; } - __pyx_L11:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":58 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":58 * done = 1 * break * if self.arr[top] < pivot: # <<<<<<<<<<<<<< @@ -5625,7 +5909,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c * break */ __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_top); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromLong((__pyx_v_self->arr[__pyx_t_1])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->arr[__pyx_t_1])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_pivot, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5633,7 +5917,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":59 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":59 * break * if self.arr[top] < pivot: * self.arr[bottom] = self.arr[top] # <<<<<<<<<<<<<< @@ -5644,7 +5928,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_bottom); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_self->arr[__pyx_t_5]) = (__pyx_v_self->arr[__pyx_t_1]); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":60 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":60 * if self.arr[top] < pivot: * self.arr[bottom] = self.arr[top] * break # <<<<<<<<<<<<<< @@ -5652,25 +5936,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c * return top */ goto __pyx_L10_break; - goto __pyx_L12; } - __pyx_L12:; } __pyx_L10_break:; } - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":61 * self.arr[bottom] = self.arr[top] * break * self.arr[top] = pivot # <<<<<<<<<<<<<< * return top * */ - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_pivot); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_pivot); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_top); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_self->arr[__pyx_t_1]) = __pyx_t_6; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":62 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":62 * break * self.arr[top] = pivot * return top # <<<<<<<<<<<<<< @@ -5682,8 +5964,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c __pyx_r = __pyx_v_top; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":39 + * raise ValueError('%s not in IntList' % val) + * + * def partition(self,start,end): # <<<<<<<<<<<<<< + * pivot = self.arr[end] + * bottom = start-1 + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); @@ -5698,6 +5987,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":64 + * return top + * + * def _doquicksort(self,start,end): # <<<<<<<<<<<<<< + * if start < end: + * split = self.partition(start,end) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -5710,7 +6007,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_9_doquicksort(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_doquicksort (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,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; @@ -5724,10 +6021,10 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_9_doquicksort(PyObject *__pyx_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end)) != 0)) 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 = 64; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -5753,18 +6050,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_9_doquicksort(PyObject *__pyx_ return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self), __pyx_v_start, __pyx_v_end); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":64 - * return top - * - * def _doquicksort(self,start,end): # <<<<<<<<<<<<<< - * if start < end: - * split = self.partition(start,end) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end) { PyObject *__pyx_v_split = NULL; PyObject *__pyx_r = NULL; @@ -5778,7 +6069,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_doquicksort", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":65 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":65 * * def _doquicksort(self,start,end): * if start < end: # <<<<<<<<<<<<<< @@ -5790,14 +6081,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":66 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":66 * def _doquicksort(self,start,end): * if start < end: * split = self.partition(start,end) # <<<<<<<<<<<<<< * self._doquicksort(start,split-1) * self._doquicksort(split+1,end) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__partition); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_partition); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -5807,21 +6098,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj __Pyx_INCREF(__pyx_v_end); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_end); __Pyx_GIVEREF(__pyx_v_end); - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_split = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":67 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":67 * if start < end: * split = self.partition(start,end) * self._doquicksort(start,split-1) # <<<<<<<<<<<<<< * self._doquicksort(split+1,end) * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___doquicksort); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doquicksort); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Subtract(__pyx_v_split, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -5833,20 +6124,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __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_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":68 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":68 * split = self.partition(start,end) * self._doquicksort(start,split-1) * self._doquicksort(split+1,end) # <<<<<<<<<<<<<< * else: * return */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___doquicksort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doquicksort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Add(__pyx_v_split, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -5858,16 +6149,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_end); __Pyx_GIVEREF(__pyx_v_end); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":70 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":70 * self._doquicksort(split+1,end) * else: * return # <<<<<<<<<<<<<< @@ -5880,6 +6171,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":64 + * return top + * + * def _doquicksort(self,start,end): # <<<<<<<<<<<<<< + * if start < end: + * split = self.partition(start,end) + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -5895,6 +6195,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":72 + * return + * + * def sort(self): # <<<<<<<<<<<<<< + * self._doquicksort(0,self.len-1) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_11sort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_11sort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { @@ -5902,18 +6210,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_11sort(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sort (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_10sort(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":72 - * return - * - * def sort(self): # <<<<<<<<<<<<<< - * self._doquicksort(0,self.len-1) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_10sort(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5925,16 +6227,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_10sort(struct __pyx_obj_4cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sort", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":73 * * def sort(self): * self._doquicksort(0,self.len-1) # <<<<<<<<<<<<<< * * def reset(self): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___doquicksort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doquicksort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromLong((__pyx_v_self->len - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_self->len - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __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[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -5944,12 +6246,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_10sort(struct __pyx_obj_4cdec_ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":72 + * return + * + * def sort(self): # <<<<<<<<<<<<<< + * self._doquicksort(0,self.len-1) + * + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -5964,6 +6275,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_10sort(struct __pyx_obj_4cdec_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":75 + * self._doquicksort(0,self.len-1) + * + * def reset(self): # <<<<<<<<<<<<<< + * self.len = 0 + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { @@ -5971,24 +6290,18 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_13reset(PyObject *__pyx_v_self __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_12reset(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":75 - * self._doquicksort(0,self.len-1) - * - * def reset(self): # <<<<<<<<<<<<<< - * self.len = 0 - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_12reset(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":76 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":76 * * def reset(self): * self.len = 0 # <<<<<<<<<<<<<< @@ -5997,34 +6310,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_12reset(struct __pyx_obj_4cdec */ __pyx_v_self->len = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":75 + * self._doquicksort(0,self.len-1) + * + * def reset(self): # <<<<<<<<<<<<<< + * self.len = 0 + * + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":78 + * self.len = 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.arr) + * + */ + /* Python wrapper */ static void __pyx_pw_4cdec_2sa_3_sa_7IntList_15__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4cdec_2sa_3_sa_7IntList_15__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_4cdec_2sa_3_sa_7IntList_14__dealloc__(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":78 - * self.len = 0 - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self.arr) - * - */ - static void __pyx_pf_4cdec_2sa_3_sa_7IntList_14__dealloc__(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":79 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":79 * * def __dealloc__(self): * free(self.arr) # <<<<<<<<<<<<<< @@ -6033,10 +6357,27 @@ static void __pyx_pf_4cdec_2sa_3_sa_7IntList_14__dealloc__(struct __pyx_obj_4cde */ free(__pyx_v_self->arr); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":78 + * self.len = 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.arr) + * + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } static PyObject *__pyx_gb_4cdec_2sa_3_sa_7IntList_18generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":81 + * free(self.arr) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef int i + * for i in range(self.len): + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_17__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_17__iter__(PyObject *__pyx_v_self) { @@ -6044,18 +6385,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_17__iter__(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_16__iter__(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":81 - * free(self.arr) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * cdef int i - * for i in range(self.len): - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_16__iter__(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self) { struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; @@ -6080,6 +6415,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_16__iter__(struct __pyx_obj_4c return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -6114,7 +6450,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_7IntList_18generator(__pyx_GeneratorObj __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":83 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":83 * def __iter__(self): * cdef int i * for i in range(self.len): # <<<<<<<<<<<<<< @@ -6125,14 +6461,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_7IntList_18generator(__pyx_GeneratorObj for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":84 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":84 * cdef int i * for i in range(self.len): * yield self.arr[i] # <<<<<<<<<<<<<< * * def __getitem__(self, index): */ - __pyx_t_3 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_self->arr[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_self->arr[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -6148,6 +6484,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_7IntList_18generator(__pyx_GeneratorObj __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":81 + * free(self.arr) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef int i + * for i in range(self.len): + */ + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -6161,6 +6507,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_7IntList_18generator(__pyx_GeneratorObj return NULL; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":86 + * yield self.arr[i] + * + * def __getitem__(self, index): # <<<<<<<<<<<<<< + * cdef int i, j, k + * if isinstance(index, int): + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_20__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_20__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { @@ -6168,18 +6522,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_20__getitem__(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":86 - * yield self.arr[i] - * - * def __getitem__(self, index): # <<<<<<<<<<<<<< - * cdef int i, j, k - * if isinstance(index, int): - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_index) { int __pyx_v_i; int __pyx_v_j; @@ -6202,7 +6550,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":88 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":88 * def __getitem__(self, index): * cdef int i, j, k * if isinstance(index, int): # <<<<<<<<<<<<<< @@ -6213,17 +6561,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":89 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":89 * cdef int i, j, k * if isinstance(index, int): * j = index # <<<<<<<<<<<<<< * if j < 0: * j = self.len + j */ - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_j = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":90 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":90 * if isinstance(index, int): * j = index * if j < 0: # <<<<<<<<<<<<<< @@ -6233,7 +6581,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj __pyx_t_2 = ((__pyx_v_j < 0) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":91 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":91 * j = index * if j < 0: * j = self.len + j # <<<<<<<<<<<<<< @@ -6245,7 +6593,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":92 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":92 * if j < 0: * j = self.len + j * if j<0 or j>=self.len: # <<<<<<<<<<<<<< @@ -6261,14 +6609,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj } if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":93 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":93 * j = self.len + j * if j<0 or j>=self.len: * raise IndexError("Requested index %d of %d-length IntList" % (index, self.len)) # <<<<<<<<<<<<<< * return self.arr[j] * elif isinstance(index, slice): */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_self->len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __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[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); @@ -6278,25 +6626,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Requested_index_d_of_d_length_In, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; } - __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":94 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":94 * if j<0 or j>=self.len: * raise IndexError("Requested index %d of %d-length IntList" % (index, self.len)) * return self.arr[j] # <<<<<<<<<<<<<< @@ -6304,15 +6650,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj * i = index.start */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyInt_FromLong((__pyx_v_self->arr[__pyx_v_j])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_self->arr[__pyx_v_j])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":95 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":95 * raise IndexError("Requested index %d of %d-length IntList" % (index, self.len)) * return self.arr[j] * elif isinstance(index, slice): # <<<<<<<<<<<<<< @@ -6323,33 +6668,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj __pyx_t_2 = (__pyx_t_4 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":96 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":96 * return self.arr[j] * elif isinstance(index, slice): * i = index.start # <<<<<<<<<<<<<< * j = index.stop * if i < 0: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_i = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":97 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":97 * elif isinstance(index, slice): * i = index.start * j = index.stop # <<<<<<<<<<<<<< * if i < 0: * i = self.len + i */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__stop); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_j = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":98 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":98 * i = index.start * j = index.stop * if i < 0: # <<<<<<<<<<<<<< @@ -6359,7 +6704,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj __pyx_t_2 = ((__pyx_v_i < 0) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":99 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":99 * j = index.stop * if i < 0: * i = self.len + i # <<<<<<<<<<<<<< @@ -6371,7 +6716,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":100 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":100 * if i < 0: * i = self.len + i * if j < 0: # <<<<<<<<<<<<<< @@ -6381,7 +6726,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj __pyx_t_2 = ((__pyx_v_j < 0) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":101 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":101 * i = self.len + i * if j < 0: * j = self.len + j # <<<<<<<<<<<<<< @@ -6393,7 +6738,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":102 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":102 * if j < 0: * j = self.len + j * if i < 0 or i >= self.len or j < 0 or j > self.len: # <<<<<<<<<<<<<< @@ -6421,18 +6766,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj } if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":103 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":103 * j = self.len + j * if i < 0 or i >= self.len or j < 0 or j > self.len: * raise IndexError("Requested index %d:%d of %d-length IntList" % (index.start, index.stop, self.len)) # <<<<<<<<<<<<<< * result = () * for k from i <= k < j: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__stop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyInt_FromLong(__pyx_v_self->len); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->len); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); @@ -6445,35 +6790,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Requested_index_d_d_of_d_length, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; } - __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":104 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":104 * if i < 0 or i >= self.len or j < 0 or j > self.len: * raise IndexError("Requested index %d:%d of %d-length IntList" % (index.start, index.stop, self.len)) * result = () # <<<<<<<<<<<<<< * for k from i <= k < j: * result = result + (self.arr[k],) */ - __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); + __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_result = __pyx_empty_tuple; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":105 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":105 * raise IndexError("Requested index %d:%d of %d-length IntList" % (index.start, index.stop, self.len)) * result = () * for k from i <= k < j: # <<<<<<<<<<<<<< @@ -6483,28 +6826,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj __pyx_t_3 = __pyx_v_j; for (__pyx_v_k = __pyx_v_i; __pyx_v_k < __pyx_t_3; __pyx_v_k++) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":106 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":106 * result = () * for k from i <= k < j: * result = result + (self.arr[k],) # <<<<<<<<<<<<<< * return result * else: */ - __pyx_t_9 = PyInt_FromLong((__pyx_v_self->arr[__pyx_v_k])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_From_int((__pyx_v_self->arr[__pyx_v_k])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_v_result, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_9)); __pyx_t_9 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":107 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":107 * for k from i <= k < j: * result = result + (self.arr[k],) * return result # <<<<<<<<<<<<<< @@ -6512,38 +6855,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj * raise TypeError("Illegal key type %s for IntList" % type(index)) */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":109 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":109 * return result * else: * raise TypeError("Illegal key type %s for IntList" % type(index)) # <<<<<<<<<<<<<< * * cdef void set(self, int i, int val): */ - __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), ((PyObject *)Py_TYPE(__pyx_v_index))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Illegal_key_type_s_for_IntList, ((PyObject *)Py_TYPE(__pyx_v_index))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_L3:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":86 + * yield self.arr[i] + * + * def __getitem__(self, index): # <<<<<<<<<<<<<< + * cdef int i, j, k + * if isinstance(index, int): + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); @@ -6558,7 +6906,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":111 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":111 * raise TypeError("Illegal key type %s for IntList" % type(index)) * * cdef void set(self, int i, int val): # <<<<<<<<<<<<<< @@ -6580,7 +6928,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":112 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":112 * * cdef void set(self, int i, int val): * j = i # <<<<<<<<<<<<<< @@ -6589,7 +6937,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_ */ __pyx_v_j = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":113 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":113 * cdef void set(self, int i, int val): * j = i * if i<0: # <<<<<<<<<<<<<< @@ -6599,7 +6947,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_ __pyx_t_1 = ((__pyx_v_i < 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":114 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":114 * j = i * if i<0: * j = self.len + i # <<<<<<<<<<<<<< @@ -6611,7 +6959,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_ } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":115 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":115 * if i<0: * j = self.len + i * if j<0 or j>=self.len: # <<<<<<<<<<<<<< @@ -6627,16 +6975,16 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_ } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":116 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":116 * j = self.len + i * if j<0 or j>=self.len: * raise IndexError("Requested index %d of %d-length IntList" % (i, self.len)) # <<<<<<<<<<<<<< * self.arr[j] = val * */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyInt_FromLong(__pyx_v_self->len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __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[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); @@ -6646,25 +6994,23 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_ __Pyx_GIVEREF(__pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Requested_index_d_of_d_length_In, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":117 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":117 * if j<0 or j>=self.len: * raise IndexError("Requested index %d of %d-length IntList" % (i, self.len)) * self.arr[j] = val # <<<<<<<<<<<<<< @@ -6673,16 +7019,33 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_ */ (__pyx_v_self->arr[__pyx_v_j]) = __pyx_v_val; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":111 + * raise TypeError("Illegal key type %s for IntList" % type(index)) + * + * cdef void set(self, int i, int val): # <<<<<<<<<<<<<< + * j = i + * if i<0: + */ + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("cdec.sa._sa.IntList.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.IntList.set", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":119 + * self.arr[j] = val + * + * def __setitem__(self, i, val): # <<<<<<<<<<<<<< + * self.set(i, val) + * + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_7IntList_22__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_7IntList_22__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { @@ -6690,18 +7053,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_7IntList_22__setitem__(PyObject *__pyx_v_self __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_21__setitem__(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_i), ((PyObject *)__pyx_v_val)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":119 - * self.arr[j] = val - * - * def __setitem__(self, i, val): # <<<<<<<<<<<<<< - * self.set(i, val) - * - */ - static int __pyx_pf_4cdec_2sa_3_sa_7IntList_21__setitem__(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations @@ -6712,17 +7069,26 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList_21__setitem__(struct __pyx_obj_4cdec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":120 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":120 * * def __setitem__(self, i, val): * self.set(i, val) # <<<<<<<<<<<<<< * * def __len__(self): */ - __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 = 120; __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->set(__pyx_v_self, __pyx_t_1, __pyx_t_2); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":119 + * self.arr[j] = val + * + * def __setitem__(self, i, val): # <<<<<<<<<<<<<< + * self.set(i, val) + * + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -6733,6 +7099,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList_21__setitem__(struct __pyx_obj_4cdec return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":122 + * self.set(i, val) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.len + * + */ + /* Python wrapper */ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_7IntList_24__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_7IntList_24__len__(PyObject *__pyx_v_self) { @@ -6740,24 +7114,18 @@ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_7IntList_24__len__(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_23__len__(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":122 - * self.set(i, val) - * - * def __len__(self): # <<<<<<<<<<<<<< - * return self.len - * - */ - static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_7IntList_23__len__(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":123 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":123 * * def __len__(self): * return self.len # <<<<<<<<<<<<<< @@ -6767,12 +7135,28 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_7IntList_23__len__(struct __pyx_obj_4c __pyx_r = __pyx_v_self->len; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":122 + * self.set(i, val) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.len + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":125 + * return self.len + * + * def get_size(self): # <<<<<<<<<<<<<< + * return self.size + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_26get_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_26get_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { @@ -6780,18 +7164,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_26get_size(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_size (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_25get_size(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":125 - * return self.len - * - * def get_size(self): # <<<<<<<<<<<<<< - * return self.size - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_25get_size(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -6801,7 +7179,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_25get_size(struct __pyx_obj_4c int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_size", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":126 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":126 * * def get_size(self): * return self.size # <<<<<<<<<<<<<< @@ -6809,14 +7187,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_25get_size(struct __pyx_obj_4c * def append(self, int val): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __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; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":125 + * return self.len + * + * def get_size(self): # <<<<<<<<<<<<<< + * return self.size + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.IntList.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -6827,6 +7212,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_25get_size(struct __pyx_obj_4c return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":128 + * return self.size + * + * def append(self, int val): # <<<<<<<<<<<<<< + * self._append(val) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_28append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_28append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { @@ -6838,7 +7231,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_28append(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("append (wrapper)", 0); assert(__pyx_arg_val); { - __pyx_v_val = __Pyx_PyInt_AsInt(__pyx_arg_val); if (unlikely((__pyx_v_val == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_val = __Pyx_PyInt_As_int(__pyx_arg_val); if (unlikely((__pyx_v_val == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6847,24 +7240,18 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_28append(PyObject *__pyx_v_sel return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_27append(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self), ((int)__pyx_v_val)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":128 - * return self.size - * - * def append(self, int val): # <<<<<<<<<<<<<< - * self._append(val) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_27append(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self, int __pyx_v_val) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("append", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":129 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":129 * * def append(self, int val): * self._append(val) # <<<<<<<<<<<<<< @@ -6873,13 +7260,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_27append(struct __pyx_obj_4cde */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->_append(__pyx_v_self, __pyx_v_val); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":128 + * return self.size + * + * def append(self, int val): # <<<<<<<<<<<<<< + * self._append(val) + * + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":131 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":131 * self._append(val) * * cdef void _append(self, int val): # <<<<<<<<<<<<<< @@ -6892,7 +7288,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3 int __pyx_t_1; __Pyx_RefNannySetupContext("_append", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":132 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":132 * * cdef void _append(self, int val): * if self.len == self.size: # <<<<<<<<<<<<<< @@ -6902,7 +7298,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3 __pyx_t_1 = ((__pyx_v_self->len == __pyx_v_self->size) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":133 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":133 * cdef void _append(self, int val): * if self.len == self.size: * self.size = self.size + self.increment # <<<<<<<<<<<<<< @@ -6911,7 +7307,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3 */ __pyx_v_self->size = (__pyx_v_self->size + __pyx_v_self->increment); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":134 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":134 * if self.len == self.size: * self.size = self.size + self.increment * self.arr = realloc(self.arr, self.size*sizeof(int)) # <<<<<<<<<<<<<< @@ -6923,7 +7319,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3 } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":135 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":135 * self.size = self.size + self.increment * self.arr = realloc(self.arr, self.size*sizeof(int)) * self.arr[self.len] = val # <<<<<<<<<<<<<< @@ -6932,7 +7328,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3 */ (__pyx_v_self->arr[__pyx_v_self->len]) = __pyx_v_val; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":136 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":136 * self.arr = realloc(self.arr, self.size*sizeof(int)) * self.arr[self.len] = val * self.len = self.len + 1 # <<<<<<<<<<<<<< @@ -6941,9 +7337,26 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3 */ __pyx_v_self->len = (__pyx_v_self->len + 1); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":131 + * self._append(val) + * + * cdef void _append(self, int val): # <<<<<<<<<<<<<< + * if self.len == self.size: + * self.size = self.size + self.increment + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":138 + * self.len = self.len + 1 + * + * def extend(self, other): # <<<<<<<<<<<<<< + * self._extend(other) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_30extend(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_30extend(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { @@ -6951,18 +7364,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_30extend(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extend (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_29extend(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":138 - * self.len = self.len + 1 - * - * def extend(self, other): # <<<<<<<<<<<<<< - * self._extend(other) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_29extend(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -6971,7 +7378,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_29extend(struct __pyx_obj_4cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extend", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":139 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":139 * * def extend(self, other): * self._extend(other) # <<<<<<<<<<<<<< @@ -6981,6 +7388,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_29extend(struct __pyx_obj_4cde if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->_extend(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_other)); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":138 + * self.len = self.len + 1 + * + * def extend(self, other): # <<<<<<<<<<<<<< + * self._extend(other) + * + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -6992,7 +7408,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_29extend(struct __pyx_obj_4cde return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":141 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":141 * self._extend(other) * * cdef void _extend(self, IntList other): # <<<<<<<<<<<<<< @@ -7004,7 +7420,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend(struct __pyx_obj_4cdec_2sa_3 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_extend", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":142 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":142 * * cdef void _extend(self, IntList other): * self._extend_arr(other.arr, other.len) # <<<<<<<<<<<<<< @@ -7013,10 +7429,19 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend(struct __pyx_obj_4cdec_2sa_3 */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->_extend_arr(__pyx_v_self, __pyx_v_other->arr, __pyx_v_other->len); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":141 + * self._extend(other) + * + * cdef void _extend(self, IntList other): # <<<<<<<<<<<<<< + * self._extend_arr(other.arr, other.len) + * + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":144 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":144 * self._extend_arr(other.arr, other.len) * * cdef void _extend_arr(self, int* other, int other_len): # <<<<<<<<<<<<<< @@ -7029,7 +7454,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2 int __pyx_t_1; __Pyx_RefNannySetupContext("_extend_arr", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":145 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":145 * * cdef void _extend_arr(self, int* other, int other_len): * if self.size < self.len + other_len: # <<<<<<<<<<<<<< @@ -7039,7 +7464,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2 __pyx_t_1 = ((__pyx_v_self->size < (__pyx_v_self->len + __pyx_v_other_len)) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":146 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":146 * cdef void _extend_arr(self, int* other, int other_len): * if self.size < self.len + other_len: * self.size = self.len + other_len # <<<<<<<<<<<<<< @@ -7048,7 +7473,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2 */ __pyx_v_self->size = (__pyx_v_self->len + __pyx_v_other_len); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":147 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":147 * if self.size < self.len + other_len: * self.size = self.len + other_len * self.arr = realloc(self.arr, self.size*sizeof(int)) # <<<<<<<<<<<<<< @@ -7060,7 +7485,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2 } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":148 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":148 * self.size = self.len + other_len * self.arr = realloc(self.arr, self.size*sizeof(int)) * memcpy(self.arr+self.len, other, other_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -7069,7 +7494,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2 */ memcpy((__pyx_v_self->arr + __pyx_v_self->len), __pyx_v_other, (__pyx_v_other_len * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":149 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":149 * self.arr = realloc(self.arr, self.size*sizeof(int)) * memcpy(self.arr+self.len, other, other_len*sizeof(int)) * self.len = self.len + other_len # <<<<<<<<<<<<<< @@ -7078,10 +7503,19 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2 */ __pyx_v_self->len = (__pyx_v_self->len + __pyx_v_other_len); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":144 + * self._extend_arr(other.arr, other.len) + * + * cdef void _extend_arr(self, int* other, int other_len): # <<<<<<<<<<<<<< + * if self.size < self.len + other_len: + * self.size = self.len + other_len + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":151 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":151 * self.len = self.len + other_len * * cdef void _clear(self): # <<<<<<<<<<<<<< @@ -7093,7 +7527,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_clear", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":152 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":152 * * cdef void _clear(self): * free(self.arr) # <<<<<<<<<<<<<< @@ -7102,7 +7536,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_ */ free(__pyx_v_self->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":153 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":153 * cdef void _clear(self): * free(self.arr) * self.len = 0 # <<<<<<<<<<<<<< @@ -7111,7 +7545,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_ */ __pyx_v_self->len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":154 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":154 * free(self.arr) * self.len = 0 * self.size = 0 # <<<<<<<<<<<<<< @@ -7120,7 +7554,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_ */ __pyx_v_self->size = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":155 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":155 * self.len = 0 * self.size = 0 * self.arr = malloc(0) # <<<<<<<<<<<<<< @@ -7129,10 +7563,19 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_ */ __pyx_v_self->arr = ((int *)malloc(0)); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":151 + * self.len = self.len + other_len + * + * cdef void _clear(self): # <<<<<<<<<<<<<< + * free(self.arr) + * self.len = 0 + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":157 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":157 * self.arr = malloc(0) * * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -7144,7 +7587,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_write_handle(struct __pyx_obj_4cdec_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_handle", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":158 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":158 * * cdef void write_handle(self, FILE* f): * fwrite(&(self.len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -7153,7 +7596,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_write_handle(struct __pyx_obj_4cdec_ */ fwrite((&__pyx_v_self->len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":159 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":159 * cdef void write_handle(self, FILE* f): * fwrite(&(self.len), sizeof(int), 1, f) * fwrite(self.arr, sizeof(int), self.len, f) # <<<<<<<<<<<<<< @@ -7162,9 +7605,26 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_write_handle(struct __pyx_obj_4cdec_ */ fwrite(__pyx_v_self->arr, (sizeof(int)), __pyx_v_self->len, __pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":157 + * self.arr = malloc(0) + * + * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< + * fwrite(&(self.len), sizeof(int), 1, f) + * fwrite(self.arr, sizeof(int), self.len, f) + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":161 + * fwrite(self.arr, sizeof(int), self.len, f) + * + * def write(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_32write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_32write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -7185,34 +7645,28 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_32write(PyObject *__pyx_v_self return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_31write(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":161 - * fwrite(self.arr, sizeof(int), self.len, f) - * - * def write(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "w") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_31write(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":163 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":163 * def write(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< * self.write_handle(f) * fclose(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":164 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":164 * cdef FILE* f * f = fopen(filename, "w") * self.write_handle(f) # <<<<<<<<<<<<<< @@ -7221,7 +7675,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_31write(struct __pyx_obj_4cdec */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":165 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":165 * f = fopen(filename, "w") * self.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -7230,13 +7684,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_31write(struct __pyx_obj_4cdec */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":161 + * fwrite(self.arr, sizeof(int), self.len, f) + * + * def write(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":167 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":167 * fclose(f) * * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -7249,7 +7712,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2 int __pyx_t_1; __Pyx_RefNannySetupContext("read_handle", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":168 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":168 * * cdef void read_handle(self, FILE* f): * (self.arr) # <<<<<<<<<<<<<< @@ -7258,7 +7721,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2 */ __pyx_v_self->arr; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":169 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":169 * cdef void read_handle(self, FILE* f): * (self.arr) * fread(&(self.len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -7267,7 +7730,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2 */ fread((&__pyx_v_self->len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":170 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":170 * (self.arr) * fread(&(self.len), sizeof(int), 1, f) * self.arr = malloc(self.len * sizeof(int)) # <<<<<<<<<<<<<< @@ -7276,7 +7739,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2 */ __pyx_v_self->arr = ((int *)malloc((__pyx_v_self->len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":171 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":171 * fread(&(self.len), sizeof(int), 1, f) * self.arr = malloc(self.len * sizeof(int)) * self.size = self.len # <<<<<<<<<<<<<< @@ -7286,7 +7749,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2 __pyx_t_1 = __pyx_v_self->len; __pyx_v_self->size = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":172 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":172 * self.arr = malloc(self.len * sizeof(int)) * self.size = self.len * fread(self.arr, sizeof(int), self.len, f) # <<<<<<<<<<<<<< @@ -7295,9 +7758,26 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2 */ fread(__pyx_v_self->arr, (sizeof(int)), __pyx_v_self->len, __pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":167 + * fclose(f) + * + * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< + * (self.arr) + * fread(&(self.len), sizeof(int), 1, f) + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":174 + * fread(self.arr, sizeof(int), self.len, f) + * + * def read(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_34read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_34read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -7318,34 +7798,28 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7IntList_34read(PyObject *__pyx_v_self, return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7IntList_33read(((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":174 - * fread(self.arr, sizeof(int), self.len, f) - * - * def read(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "r") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_33read(struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":176 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":176 * def read(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< * self.read_handle(f) * fclose(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":177 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":177 * cdef FILE* f * f = fopen(filename, "r") * self.read_handle(f) # <<<<<<<<<<<<<< @@ -7353,19 +7827,36 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_33read(struct __pyx_obj_4cdec_ */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/int_list.pxi":178 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":178 * f = fopen(filename, "r") * self.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/int_list.pxi":174 + * fread(self.arr, sizeof(int), self.len, f) + * + * def read(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":13 + * cdef int index(self, char *s) + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.vocab = stringmap_new() + * + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -7376,24 +7867,18 @@ static int __pyx_pw_4cdec_2sa_3_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, __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_4cdec_2sa_3_sa_9StringMap___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/str_map.pxi":13 - * cdef int index(self, char *s) - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.vocab = stringmap_new() - * - */ - static int __pyx_pf_4cdec_2sa_3_sa_9StringMap___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_StringMap *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/str_map.pxi":14 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":14 * * def __cinit__(self): * self.vocab = stringmap_new() # <<<<<<<<<<<<<< @@ -7402,33 +7887,44 @@ static int __pyx_pf_4cdec_2sa_3_sa_9StringMap___cinit__(struct __pyx_obj_4cdec_2 */ __pyx_v_self->vocab = stringmap_new(); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":13 + * cdef int index(self, char *s) + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.vocab = stringmap_new() + * + */ + + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":16 + * self.vocab = stringmap_new() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * stringmap_delete(self.vocab) + * + */ + /* Python wrapper */ static void __pyx_pw_4cdec_2sa_3_sa_9StringMap_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4cdec_2sa_3_sa_9StringMap_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_4cdec_2sa_3_sa_9StringMap_2__dealloc__(((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/str_map.pxi":16 - * self.vocab = stringmap_new() - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * stringmap_delete(self.vocab) - * - */ - static void __pyx_pf_4cdec_2sa_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_4cdec_2sa_3_sa_StringMap *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/str_map.pxi":17 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":17 * * def __dealloc__(self): * stringmap_delete(self.vocab) # <<<<<<<<<<<<<< @@ -7437,10 +7933,19 @@ static void __pyx_pf_4cdec_2sa_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_4cd */ stringmap_delete(__pyx_v_self->vocab); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":16 + * self.vocab = stringmap_new() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * stringmap_delete(self.vocab) + * + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/str_map.pxi":19 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":19 * stringmap_delete(self.vocab) * * cdef char *word(self, int i): # <<<<<<<<<<<<<< @@ -7453,7 +7958,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_9StringMap_word(struct __pyx_obj_4cdec_2sa_3 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("word", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/str_map.pxi":20 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":20 * * cdef char *word(self, int i): * return stringmap_word(self.vocab, i) # <<<<<<<<<<<<<< @@ -7463,13 +7968,21 @@ static char *__pyx_f_4cdec_2sa_3_sa_9StringMap_word(struct __pyx_obj_4cdec_2sa_3 __pyx_r = stringmap_word(__pyx_v_self->vocab, __pyx_v_i); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":19 + * stringmap_delete(self.vocab) + * + * cdef char *word(self, int i): # <<<<<<<<<<<<<< + * return stringmap_word(self.vocab, i) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/str_map.pxi":22 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":22 * return stringmap_word(self.vocab, i) * * cdef int index(self, char *s): # <<<<<<<<<<<<<< @@ -7481,7 +7994,7 @@ static int __pyx_f_4cdec_2sa_3_sa_9StringMap_index(struct __pyx_obj_4cdec_2sa_3_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("index", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/str_map.pxi":23 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":23 * * cdef int index(self, char *s): * return stringmap_index(self.vocab, s) # <<<<<<<<<<<<<< @@ -7489,12 +8002,27 @@ static int __pyx_f_4cdec_2sa_3_sa_9StringMap_index(struct __pyx_obj_4cdec_2sa_3_ __pyx_r = stringmap_index(__pyx_v_self->vocab, __pyx_v_s); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/str_map.pxi":22 + * return stringmap_word(self.vocab, i) + * + * cdef int index(self, char *s): # <<<<<<<<<<<<<< + * return stringmap_index(self.vocab, s) + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":17 + * cdef bint use_sent_id + * + * def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False): # <<<<<<<<<<<<<< + * self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1} + * self.id2word = ["END_OF_FILE", "END_OF_LINE"] + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -7509,16 +8037,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__side,&__pyx_n_s__use_sent_id,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_from_binary,&__pyx_n_s_from_text,&__pyx_n_s_side,&__pyx_n_s_use_sent_id,0}; PyObject* values[4] = {0,0,0,0}; - - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":17 - * cdef bint use_sent_id - * - * def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False): # <<<<<<<<<<<<<< - * self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1} - * self.id2word = ["END_OF_FILE", "END_OF_LINE"] - */ values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); @@ -7537,22 +8057,22 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_binary); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_binary); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_text); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_text); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__side); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_side); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_sent_id); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_sent_id); if (value) { values[3] = value; kw_args--; } } } @@ -7587,6 +8107,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), __pyx_v_from_binary, __pyx_v_from_text, __pyx_v_side, __pyx_v_use_sent_id); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7598,13 +8120,12 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - long __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":18 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":18 * * def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False): * self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1} # <<<<<<<<<<<<<< @@ -7612,16 +8133,16 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 * self.data = IntList(1000,1000) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__END_OF_FILE), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__END_OF_LINE), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_END_OF_FILE, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_END_OF_LINE, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->word2id); __Pyx_DECREF(__pyx_v_self->word2id); - __pyx_v_self->word2id = ((PyObject *)__pyx_t_1); + __pyx_v_self->word2id = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":19 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":19 * def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False): * self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1} * self.id2word = ["END_OF_FILE", "END_OF_LINE"] # <<<<<<<<<<<<<< @@ -7630,26 +8151,26 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__END_OF_FILE)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__END_OF_FILE)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__END_OF_FILE)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__END_OF_LINE)); - PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__END_OF_LINE)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__END_OF_LINE)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(__pyx_n_s_END_OF_FILE); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_END_OF_FILE); + __Pyx_GIVEREF(__pyx_n_s_END_OF_FILE); + __Pyx_INCREF(__pyx_n_s_END_OF_LINE); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_END_OF_LINE); + __Pyx_GIVEREF(__pyx_n_s_END_OF_LINE); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->id2word); __Pyx_DECREF(__pyx_v_self->id2word); - __pyx_v_self->id2word = ((PyObject *)__pyx_t_1); + __pyx_v_self->id2word = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":20 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":20 * self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1} * self.id2word = ["END_OF_FILE", "END_OF_LINE"] * self.data = IntList(1000,1000) # <<<<<<<<<<<<<< * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_tuple__3, 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); @@ -7657,14 +8178,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 __pyx_v_self->data = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":21 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":21 * self.id2word = ["END_OF_FILE", "END_OF_LINE"] * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) # <<<<<<<<<<<<<< * self.sent_index = IntList(1000,1000) * self.use_sent_id = use_sent_id */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_tuple__4, 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); @@ -7672,14 +8193,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 __pyx_v_self->sent_id = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":22 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":22 * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< * self.use_sent_id = use_sent_id * if from_binary: */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_tuple__5, 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); @@ -7687,7 +8208,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 __pyx_v_self->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":23 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":23 * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) * self.use_sent_id = use_sent_id # <<<<<<<<<<<<<< @@ -7696,7 +8217,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 */ __pyx_v_self->use_sent_id = __pyx_v_use_sent_id; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":24 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":24 * self.sent_index = IntList(1000,1000) * self.use_sent_id = use_sent_id * if from_binary: # <<<<<<<<<<<<<< @@ -7706,29 +8227,29 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":25 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":25 * self.use_sent_id = use_sent_id * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< * elif from_text: * if side: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__read_binary); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_binary); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 25; __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[3]; __pyx_lineno = 25; __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[3]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 25; __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":26 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":26 * if from_binary: * self.read_binary(from_binary) * elif from_text: # <<<<<<<<<<<<<< @@ -7738,7 +8259,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":27 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":27 * self.read_binary(from_binary) * elif from_text: * if side: # <<<<<<<<<<<<<< @@ -7748,25 +8269,23 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_side); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":28 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":28 * elif from_text: * if side: * self.read_bitext(from_text, (0 if side == 'source' else 1)) # <<<<<<<<<<<<<< * else: * self.read_text(from_text) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__read_bitext); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_bitext); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_side, ((PyObject *)__pyx_n_s__source), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_side, __pyx_n_s_source, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; } else { - __pyx_t_5 = 1; + __Pyx_INCREF(__pyx_int_1); + __pyx_t_3 = __pyx_int_1; } - __pyx_t_3 = PyInt_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_from_text); @@ -7775,33 +8294,33 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __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_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":30 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":30 * self.read_bitext(from_text, (0 if side == 'source' else 1)) * else: * self.read_text(from_text) # <<<<<<<<<<<<<< * * def __len__(self): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_text); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_from_text); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_from_text); __Pyx_GIVEREF(__pyx_v_from_text); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L4:; @@ -7809,6 +8328,15 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":17 + * cdef bint use_sent_id + * + * def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False): # <<<<<<<<<<<<<< + * self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1} + * self.id2word = ["END_OF_FILE", "END_OF_LINE"] + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -7822,6 +8350,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2 return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":32 + * self.read_text(from_text) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self.data) + * + */ + /* Python wrapper */ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_9DataArray_3__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_9DataArray_3__len__(PyObject *__pyx_v_self) { @@ -7829,18 +8365,12 @@ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_9DataArray_3__len__(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_2__len__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":32 - * self.read_text(from_text) - * - * def __len__(self): # <<<<<<<<<<<<<< - * return len(self.data) - * - */ - static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9DataArray_2__len__(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations @@ -7851,7 +8381,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9DataArray_2__len__(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":33 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":33 * * def __len__(self): * return len(self.data) # <<<<<<<<<<<<<< @@ -7865,8 +8395,15 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9DataArray_2__len__(struct __pyx_obj_4 __pyx_r = __pyx_t_2; goto __pyx_L0; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":32 + * self.read_text(from_text) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self.data) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.DataArray.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -7876,6 +8413,14 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9DataArray_2__len__(struct __pyx_obj_4 return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":35 + * return len(self.data) + * + * def get_sentence_id(self, i): # <<<<<<<<<<<<<< + * return self.sent_id.arr[i] + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_5get_sentence_id(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_5get_sentence_id(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -7883,18 +8428,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_5get_sentence_id(PyObject *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_sentence_id (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_4get_sentence_id(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":35 - * return len(self.data) - * - * def get_sentence_id(self, i): # <<<<<<<<<<<<<< - * return self.sent_id.arr[i] - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_4get_sentence_id(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -7905,7 +8444,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_4get_sentence_id(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sentence_id", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":36 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":36 * * def get_sentence_id(self, i): * return self.sent_id.arr[i] # <<<<<<<<<<<<<< @@ -7914,14 +8453,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_4get_sentence_id(struct __py */ __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[3]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong((__pyx_v_self->sent_id->arr[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->sent_id->arr[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":35 + * return len(self.data) + * + * def get_sentence_id(self, i): # <<<<<<<<<<<<<< + * return self.sent_id.arr[i] + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.DataArray.get_sentence_id", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -7932,6 +8478,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_4get_sentence_id(struct __py return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":38 + * return self.sent_id.arr[i] + * + * def get_sentence(self, i): # <<<<<<<<<<<<<< + * cdef int j, start, stop + * sent = [] + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7get_sentence(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7get_sentence(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -7939,18 +8493,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7get_sentence(PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_sentence (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":38 - * return self.sent_id.arr[i] - * - * def get_sentence(self, i): # <<<<<<<<<<<<<< - * cdef int j, start, stop - * sent = [] - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i) { int __pyx_v_start; int __pyx_v_stop; @@ -7968,7 +8516,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o __Pyx_RefNannySetupContext("get_sentence", 0); __Pyx_INCREF(__pyx_v_i); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":40 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":40 * def get_sentence(self, i): * cdef int j, start, stop * sent = [] # <<<<<<<<<<<<<< @@ -7980,7 +8528,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o __pyx_v_sent = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":41 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":41 * cdef int j, start, stop * sent = [] * start = self.sent_index.arr[i] # <<<<<<<<<<<<<< @@ -7990,7 +8538,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_t_2]); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":42 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":42 * sent = [] * start = self.sent_index.arr[i] * stop = self.sent_index.arr[i+1] # <<<<<<<<<<<<<< @@ -8003,7 +8551,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_stop = (__pyx_v_self->sent_index->arr[__pyx_t_2]); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":43 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":43 * start = self.sent_index.arr[i] * stop = self.sent_index.arr[i+1] * for i from start <= i < stop: # <<<<<<<<<<<<<< @@ -8012,12 +8560,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o */ __pyx_t_3 = __pyx_v_stop; for (__pyx_t_4 = __pyx_v_start; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { - __pyx_t_1 = PyInt_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":44 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":44 * stop = self.sent_index.arr[i+1] * for i from start <= i < stop: * sent.append(self.id2word[self.data.arr[i]]) # <<<<<<<<<<<<<< @@ -8025,26 +8573,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o * */ __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->id2word, (__pyx_v_self->data->arr[__pyx_t_2]), sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->id2word, (__pyx_v_self->data->arr[__pyx_t_2]), int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_sent, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":43 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":43 * start = self.sent_index.arr[i] * stop = self.sent_index.arr[i+1] * for i from start <= i < stop: # <<<<<<<<<<<<<< * sent.append(self.id2word[self.data.arr[i]]) * return sent */ - __pyx_t_1 = PyInt_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":45 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":45 * for i from start <= i < stop: * sent.append(self.id2word[self.data.arr[i]]) * return sent # <<<<<<<<<<<<<< @@ -8052,12 +8600,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o * def get_id(self, word): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_sent)); - __pyx_r = ((PyObject *)__pyx_v_sent); + __Pyx_INCREF(__pyx_v_sent); + __pyx_r = __pyx_v_sent; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":38 + * return self.sent_id.arr[i] + * + * def get_sentence(self, i): # <<<<<<<<<<<<<< + * cdef int j, start, stop + * sent = [] + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.DataArray.get_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -8070,6 +8625,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":47 + * return sent + * + * def get_id(self, word): # <<<<<<<<<<<<<< + * if not word in self.word2id: + * self.word2id[word] = len(self.id2word) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_9get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_9get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word) { @@ -8077,18 +8640,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_9get_id(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_id (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_word)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":47 - * return sent - * - * def get_id(self, word): # <<<<<<<<<<<<<< - * if not word in self.word2id: - * self.word2id[word] = len(self.id2word) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -8096,23 +8653,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cd int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; + int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_id", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":48 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":48 * * def get_id(self, word): * if not word in self.word2id: # <<<<<<<<<<<<<< * self.word2id[word] = len(self.id2word) * self.id2word.append(word) */ - __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_word, __pyx_v_self->word2id, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_word, __pyx_v_self->word2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":49 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":49 * def get_id(self, word): * if not word in self.word2id: * self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<< @@ -8125,24 +8683,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cd __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyObject_SetItem(__pyx_v_self->word2id, __pyx_v_word, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyObject_SetItem(__pyx_v_self->word2id, __pyx_v_word, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":50 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":50 * if not word in self.word2id: * self.word2id[word] = len(self.id2word) * self.id2word.append(word) # <<<<<<<<<<<<<< * return self.word2id[word] * */ - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_self->id2word, __pyx_v_word); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2word, __pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":51 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":51 * self.word2id[word] = len(self.id2word) * self.id2word.append(word) * return self.word2id[word] # <<<<<<<<<<<<<< @@ -8150,14 +8706,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cd * def __getitem__(self, loc): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyObject_GetItem(__pyx_v_self->word2id, __pyx_v_word); if (!__pyx_t_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->word2id, __pyx_v_word); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":47 + * return sent + * + * def get_id(self, word): # <<<<<<<<<<<<<< + * if not word in self.word2id: + * self.word2id[word] = len(self.id2word) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cdec.sa._sa.DataArray.get_id", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -8168,6 +8731,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cd return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":53 + * return self.word2id[word] + * + * def __getitem__(self, loc): # <<<<<<<<<<<<<< + * return self.id2word[self.data.arr[loc]] + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) { @@ -8175,18 +8746,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_11__getitem__(PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_10__getitem__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_loc)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":53 - * return self.word2id[word] - * - * def __getitem__(self, loc): # <<<<<<<<<<<<<< - * return self.id2word[self.data.arr[loc]] - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_10__getitem__(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -8197,7 +8762,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_10__getitem__(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":54 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":54 * * def __getitem__(self, loc): * return self.id2word[self.data.arr[loc]] # <<<<<<<<<<<<<< @@ -8206,14 +8771,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_10__getitem__(struct __pyx_o */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->id2word, (__pyx_v_self->data->arr[__pyx_t_1]), sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->id2word, (__pyx_v_self->data->arr[__pyx_t_1]), int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":53 + * return self.word2id[word] + * + * def __getitem__(self, loc): # <<<<<<<<<<<<<< + * return self.id2word[self.data.arr[loc]] + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.DataArray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -8224,6 +8796,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_10__getitem__(struct __pyx_o return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":56 + * return self.id2word[self.data.arr[loc]] + * + * def get_sentence_bounds(self, loc): # <<<<<<<<<<<<<< + * cdef int sid = self.sent_id.arr[loc] + * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_13get_sentence_bounds(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_13get_sentence_bounds(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) { @@ -8231,18 +8811,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_13get_sentence_bounds(PyObje __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_sentence_bounds (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_loc)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":56 - * return self.id2word[self.data.arr[loc]] - * - * def get_sentence_bounds(self, loc): # <<<<<<<<<<<<<< - * cdef int sid = self.sent_id.arr[loc] - * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc) { int __pyx_v_sid; PyObject *__pyx_r = NULL; @@ -8256,7 +8830,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sentence_bounds", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":57 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":57 * * def get_sentence_bounds(self, loc): * cdef int sid = self.sent_id.arr[loc] # <<<<<<<<<<<<<< @@ -8266,7 +8840,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(struct __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_sid = (__pyx_v_self->sent_id->arr[__pyx_t_1]); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":58 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":58 * def get_sentence_bounds(self, loc): * cdef int sid = self.sent_id.arr[loc] * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) # <<<<<<<<<<<<<< @@ -8274,9 +8848,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(struct * def write_text(self, char* filename): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromLong((__pyx_v_self->sent_index->arr[__pyx_v_sid])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->sent_index->arr[__pyx_v_sid])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong((__pyx_v_self->sent_index->arr[(__pyx_v_sid + 1)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->sent_index->arr[(__pyx_v_sid + 1)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __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[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -8286,12 +8860,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(struct __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_r = ((PyObject *)__pyx_t_4); + __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":56 + * return self.id2word[self.data.arr[loc]] + * + * def get_sentence_bounds(self, loc): # <<<<<<<<<<<<<< + * cdef int sid = self.sent_id.arr[loc] + * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); @@ -8304,6 +8885,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(struct return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":60 + * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) + * + * def write_text(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * for w_id in self.data: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -8324,18 +8913,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_15write_text(PyObject *__pyx return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":60 - * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) - * - * def write_text(self, char* filename): # <<<<<<<<<<<<<< - * with open(filename, "w") as f: - * for w_id in self.data: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_w_id = NULL; @@ -8360,7 +8943,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":61 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -8369,23 +8952,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob */ /*with:*/ { __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __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)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__w)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_w); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_w); + __Pyx_GIVEREF(__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[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __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 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __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[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __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; @@ -8400,7 +8983,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":62 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":62 * def write_text(self, char* filename): * with open(filename, "w") as f: * for w_id in self.data: # <<<<<<<<<<<<<< @@ -8433,8 +9016,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -8444,7 +9028,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob __Pyx_XDECREF_SET(__pyx_v_w_id, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":63 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":63 * with open(filename, "w") as f: * for w_id in self.data: * if w_id > 1: # <<<<<<<<<<<<<< @@ -8456,44 +9040,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":64 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":64 * for w_id in self.data: * if w_id > 1: * f.write("%s " % self.get_word(w_id)) # <<<<<<<<<<<<<< * if w_id == 1: * f.write("\n") */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__get_word); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_word); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_w_id); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_w_id); __Pyx_GIVEREF(__pyx_v_w_id); - __pyx_t_12 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_14), __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_11)); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L18; } __pyx_L18:; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":65 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":65 * if w_id > 1: * f.write("%s " % self.get_word(w_id)) * if w_id == 1: # <<<<<<<<<<<<<< @@ -8505,16 +9089,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":66 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":66 * f.write("%s " % self.get_word(w_id)) * if w_id == 1: * f.write("\n") # <<<<<<<<<<<<<< * * def read_text(self, char* filename): */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -8535,7 +9119,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":61 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -8548,19 +9132,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_1 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_13 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); @@ -8570,14 +9146,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_4, __pyx_t_12, __pyx_t_11); __pyx_t_4 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L22; } - __pyx_L22:; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -8598,15 +9171,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob } } /*finally:*/ { - if (__pyx_t_3) { - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_17, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_14 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_3) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L23; __pyx_L3_error:; @@ -8615,6 +9190,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob __pyx_L23:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":60 + * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) + * + * def write_text(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * for w_id in self.data: + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -8633,6 +9217,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":68 + * f.write("\n") + * + * def read_text(self, char* filename): # <<<<<<<<<<<<<< + * with gzip_or_text(filename) as fp: + * self.read_text_data(fp) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -8653,18 +9245,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_17read_text(PyObject *__pyx_ return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":68 - * f.write("\n") - * - * def read_text(self, char* filename): # <<<<<<<<<<<<<< - * with gzip_or_text(filename) as fp: - * self.read_text_data(fp) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_fp = NULL; PyObject *__pyx_r = NULL; @@ -8677,15 +9263,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":69 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":69 * * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -8693,24 +9279,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj * */ /*with:*/ { - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __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)); + 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[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __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; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_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[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -8725,24 +9311,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj __pyx_v_fp = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":70 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":70 * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: * self.read_text_data(fp) # <<<<<<<<<<<<<< * * def read_bitext(self, char* filename, int side): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_text_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_fp); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fp); __Pyx_GIVEREF(__pyx_v_fp); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L7_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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -8754,7 +9340,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":69 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":69 * * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -8767,36 +9353,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_8 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_10 = PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __pyx_t_11 = ((!(__pyx_t_9 != 0)) != 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L18; } - __pyx_L18:; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8817,15 +9392,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj } } /*finally:*/ { - if (__pyx_t_4) { - __pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_k_tuple_18, NULL); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_11 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_4) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__9, NULL); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; @@ -8834,6 +9411,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj __pyx_L19:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":68 + * f.write("\n") + * + * def read_text(self, char* filename): # <<<<<<<<<<<<<< + * with gzip_or_text(filename) as fp: + * self.read_text_data(fp) + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -8850,6 +9436,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":72 + * self.read_text_data(fp) + * + * def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<< + * with gzip_or_text(filename) as fp: + * data = (line.split(' ||| ')[side] for line in fp) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -8862,7 +9456,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_19read_bitext(PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_bitext (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__side,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_side,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -8876,10 +9470,10 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_19read_bitext(PyObject *__py kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__side)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_side)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_bitext", 1, 2, 2, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -8894,7 +9488,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_19read_bitext(PyObject *__py values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_side = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_side == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_side = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_side == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; @@ -8905,12 +9499,14 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_19read_bitext(PyObject *__py return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), __pyx_v_filename, __pyx_v_side); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":74 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":74 * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: * data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<< @@ -8942,6 +9538,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_11read_bitext_genexpr(PyObje return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -9004,8 +9601,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator6(__ } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -9016,12 +9614,12 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator6(__ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s__split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_side, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_side, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; @@ -9044,6 +9642,8 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator6(__ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -9059,7 +9659,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator6(__ return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":72 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":72 * self.read_text_data(fp) * * def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<< @@ -9080,8 +9680,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -9095,7 +9695,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o __Pyx_GOTREF(__pyx_cur_scope); __pyx_cur_scope->__pyx_v_side = __pyx_v_side; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":73 * * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -9103,24 +9703,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o * self.read_text_data(data) */ /*with:*/ { - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __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)); + 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[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __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; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_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[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -9136,7 +9736,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o __pyx_cur_scope->__pyx_v_fp = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":74 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":74 * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: * data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<< @@ -9148,24 +9748,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":75 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":75 * with gzip_or_text(filename) as fp: * data = (line.split(' ||| ')[side] for line in fp) * self.read_text_data(data) # <<<<<<<<<<<<<< * * def read_text_data(self, data): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_text_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L7_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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -9177,7 +9777,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":73 * * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -9190,36 +9790,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_8 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_10 = PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __pyx_t_11 = ((!(__pyx_t_9 != 0)) != 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L18; } - __pyx_L18:; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9240,15 +9829,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o } } /*finally:*/ { - if (__pyx_t_4) { - __pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_k_tuple_21, NULL); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_11 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_4) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; @@ -9257,6 +9848,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o __pyx_L19:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":72 + * self.read_text_data(fp) + * + * def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<< + * with gzip_or_text(filename) as fp: + * data = (line.split(' ||| ')[side] for line in fp) + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -9274,6 +9874,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":77 + * self.read_text_data(data) + * + * def read_text_data(self, data): # <<<<<<<<<<<<<< + * cdef int word_count = 0 + * for line_num, line in enumerate(data): + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_21read_text_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_21read_text_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data) { @@ -9281,18 +9889,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_21read_text_data(PyObject *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_text_data (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_data)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":77 - * self.read_text_data(data) - * - * def read_text_data(self, data): # <<<<<<<<<<<<<< - * cdef int word_count = 0 - * for line_num, line in enumerate(data): - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_data) { int __pyx_v_word_count; PyObject *__pyx_v_line_num = NULL; @@ -9305,18 +9907,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); - PyObject *__pyx_t_9 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text_data", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":78 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":78 * * def read_text_data(self, data): * cdef int word_count = 0 # <<<<<<<<<<<<<< @@ -9325,7 +9928,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py */ __pyx_v_word_count = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":79 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":79 * def read_text_data(self, data): * cdef int word_count = 0 * for line_num, line in enumerate(data): # <<<<<<<<<<<<<< @@ -9360,8 +9963,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py } 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(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -9378,118 +9982,113 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":80 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":80 * cdef int word_count = 0 * for line_num, line in enumerate(data): * self.sent_index.append(word_count) # <<<<<<<<<<<<<< * for word in line.split(): * self.data.append(self.get_id(word)) */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_word_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_word_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":81 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":81 * for line_num, line in enumerate(data): * self.sent_index.append(word_count) * for word in line.split(): # <<<<<<<<<<<<<< * self.data.append(self.get_id(word)) * if self.use_sent_id: */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s__split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) { - __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; - __pyx_t_8 = NULL; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; + __pyx_t_9 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; + __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { - if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break; + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) { - if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_5 = __pyx_t_8(__pyx_t_6); - if (unlikely(!__pyx_t_5)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_7 = __pyx_t_9(__pyx_t_5); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_7); + __pyx_t_7 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":82 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":82 * self.sent_index.append(word_count) * for word in line.split(): * self.data.append(self.get_id(word)) # <<<<<<<<<<<<<< * if self.use_sent_id: * self.sent_id.append(line_num) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__get_id); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_id); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_word); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_word); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_word); __Pyx_GIVEREF(__pyx_v_word); - __pyx_t_10 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_t_11); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":83 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":83 * for word in line.split(): * self.data.append(self.get_id(word)) * if self.use_sent_id: # <<<<<<<<<<<<<< * self.sent_id.append(line_num) * word_count = word_count + 1 */ - __pyx_t_11 = (__pyx_v_self->use_sent_id != 0); - if (__pyx_t_11) { + __pyx_t_12 = (__pyx_v_self->use_sent_id != 0); + if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":84 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":84 * self.data.append(self.get_id(word)) * if self.use_sent_id: * self.sent_id.append(line_num) # <<<<<<<<<<<<<< * word_count = word_count + 1 * self.data.append(1) */ - __pyx_t_9 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_id), __pyx_v_line_num); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_id), __pyx_v_line_num); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":85 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":85 * if self.use_sent_id: * self.sent_id.append(line_num) * word_count = word_count + 1 # <<<<<<<<<<<<<< @@ -9498,44 +10097,40 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py */ __pyx_v_word_count = (__pyx_v_word_count + 1); } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":86 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":86 * self.sent_id.append(line_num) * word_count = word_count + 1 * self.data.append(1) # <<<<<<<<<<<<<< * if self.use_sent_id: * self.sent_id.append(line_num) */ - __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":87 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":87 * word_count = word_count + 1 * self.data.append(1) * if self.use_sent_id: # <<<<<<<<<<<<<< * self.sent_id.append(line_num) * word_count = word_count + 1 */ - __pyx_t_11 = (__pyx_v_self->use_sent_id != 0); - if (__pyx_t_11) { + __pyx_t_12 = (__pyx_v_self->use_sent_id != 0); + if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":88 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":88 * self.data.append(1) * if self.use_sent_id: * self.sent_id.append(line_num) # <<<<<<<<<<<<<< * word_count = word_count + 1 * self.data.append(0) */ - __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_id), __pyx_v_line_num); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_id), __pyx_v_line_num); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":89 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":89 * if self.use_sent_id: * self.sent_id.append(line_num) * word_count = word_count + 1 # <<<<<<<<<<<<<< @@ -9547,40 +10142,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":90 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":90 * self.sent_id.append(line_num) * word_count = word_count + 1 * self.data.append(0) # <<<<<<<<<<<<<< * self.sent_index.append(word_count) * */ - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_0); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":91 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":91 * word_count = word_count + 1 * self.data.append(0) * self.sent_index.append(word_count) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_word_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_word_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":77 + * self.read_text_data(data) + * + * def read_text_data(self, data): # <<<<<<<<<<<<<< + * cdef int word_count = 0 + * for line_num, line in enumerate(data): + */ + + /* function exit code */ __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_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("cdec.sa._sa.DataArray.read_text_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -9592,6 +10192,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":94 + * + * + * def read_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_23read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_23read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -9612,34 +10220,28 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_23read_binary(PyObject *__py return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_22read_binary(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":94 - * - * - * def read_binary(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "r") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_22read_binary(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":96 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":96 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< * self.read_handle(f) * fclose(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":97 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":97 * cdef FILE* f * f = fopen(filename, "r") * self.read_handle(f) # <<<<<<<<<<<<<< @@ -9648,7 +10250,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_22read_binary(struct __pyx_o */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":98 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":98 * f = fopen(filename, "r") * self.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -9657,13 +10259,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_22read_binary(struct __pyx_o */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":94 + * + * + * def read_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":100 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":100 * fclose(f) * * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -9683,12 +10294,13 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec Py_ssize_t __pyx_t_4; 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("read_handle", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":105 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":105 * cdef char* word * * self.data.read_handle(f) # <<<<<<<<<<<<<< @@ -9697,7 +10309,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->read_handle(__pyx_v_self->data, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":106 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":106 * * self.data.read_handle(f) * self.sent_index.read_handle(f) # <<<<<<<<<<<<<< @@ -9706,7 +10318,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":107 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":107 * self.data.read_handle(f) * self.sent_index.read_handle(f) * self.sent_id.read_handle(f) # <<<<<<<<<<<<<< @@ -9715,7 +10327,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->read_handle(__pyx_v_self->sent_id, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":108 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":108 * self.sent_index.read_handle(f) * self.sent_id.read_handle(f) * fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -9724,7 +10336,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec */ fread((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":109 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":109 * self.sent_id.read_handle(f) * fread(&(num_words), sizeof(int), 1, f) * for i in range(num_words): # <<<<<<<<<<<<<< @@ -9735,7 +10347,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":110 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":110 * fread(&(num_words), sizeof(int), 1, f) * for i in range(num_words): * fread(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -9744,7 +10356,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec */ fread((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":111 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":111 * for i in range(num_words): * fread(&(word_len), sizeof(int), 1, f) * word = malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<< @@ -9753,7 +10365,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec */ __pyx_v_word = ((char *)malloc((__pyx_v_word_len * (sizeof(char))))); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":112 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":112 * fread(&(word_len), sizeof(int), 1, f) * word = malloc (word_len * sizeof(char)) * fread(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<< @@ -9762,7 +10374,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec */ fread(__pyx_v_word, (sizeof(char)), __pyx_v_word_len, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":113 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":113 * word = malloc (word_len * sizeof(char)) * fread(word, sizeof(char), word_len, f) * self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<< @@ -9776,12 +10388,12 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (PyObject_SetItem(__pyx_v_self->word2id, ((PyObject *)__pyx_t_5), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_v_self->word2id, __pyx_t_5, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":114 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":114 * fread(word, sizeof(char), word_len, f) * self.word2id[word] = len(self.id2word) * self.id2word.append(word) # <<<<<<<<<<<<<< @@ -9789,13 +10401,11 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec * if len(self.sent_id) == 0: */ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2word, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_self->id2word, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":115 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":115 * self.word2id[word] = len(self.id2word) * self.id2word.append(word) * free(word) # <<<<<<<<<<<<<< @@ -9805,21 +10415,21 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec free(__pyx_v_word); } - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":116 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":116 * self.id2word.append(word) * free(word) * if len(self.sent_id) == 0: # <<<<<<<<<<<<<< * self.use_sent_id = False * else: */ - __pyx_t_5 = ((PyObject *)__pyx_v_self->sent_id); - __Pyx_INCREF(__pyx_t_5); - __pyx_t_4 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = ((__pyx_t_4 == 0) != 0); - if (__pyx_t_6) { + __pyx_t_3 = ((PyObject *)__pyx_v_self->sent_id); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = ((__pyx_t_4 == 0) != 0); + if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":117 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":117 * free(word) * if len(self.sent_id) == 0: * self.use_sent_id = False # <<<<<<<<<<<<<< @@ -9831,7 +10441,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":119 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":119 * self.use_sent_id = False * else: * self.use_sent_id = True # <<<<<<<<<<<<<< @@ -9842,16 +10452,25 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec } __pyx_L5:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":100 + * fclose(f) + * + * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< + * cdef int num_words, word_len + * cdef unsigned i + */ + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); - __Pyx_WriteUnraisable("cdec.sa._sa.DataArray.read_handle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.DataArray.read_handle", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":121 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":121 * self.use_sent_id = True * * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -9875,7 +10494,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_handle", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":125 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":125 * cdef int num_words * * self.data.write_handle(f) # <<<<<<<<<<<<<< @@ -9884,7 +10503,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->write_handle(__pyx_v_self->data, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":126 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":126 * * self.data.write_handle(f) * self.sent_index.write_handle(f) # <<<<<<<<<<<<<< @@ -9893,7 +10512,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":127 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":127 * self.data.write_handle(f) * self.sent_index.write_handle(f) * self.sent_id.write_handle(f) # <<<<<<<<<<<<<< @@ -9902,7 +10521,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->write_handle(__pyx_v_self->sent_id, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":128 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":128 * self.sent_index.write_handle(f) * self.sent_id.write_handle(f) * num_words = len(self.id2word) - 2 # <<<<<<<<<<<<<< @@ -9915,7 +10534,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_words = (__pyx_t_2 - 2); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":129 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":129 * self.sent_id.write_handle(f) * num_words = len(self.id2word) - 2 * fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -9924,14 +10543,14 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde */ fwrite((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":130 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":130 * num_words = len(self.id2word) - 2 * fwrite(&(num_words), sizeof(int), 1, f) * for word in self.id2word[2:]: # <<<<<<<<<<<<<< * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_self->id2word, 2, 0, NULL, NULL, &__pyx_k_slice_22, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_self->id2word, 2, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; @@ -9960,8 +10579,9 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde } else { __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -9971,7 +10591,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":131 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":131 * fwrite(&(num_words), sizeof(int), 1, f) * for word in self.id2word[2:]: * word_len = len(word) + 1 # <<<<<<<<<<<<<< @@ -9981,7 +10601,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde __pyx_t_5 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_word_len = (__pyx_t_5 + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":132 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":132 * for word in self.id2word[2:]: * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -9990,7 +10610,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde */ fwrite((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":133 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":133 * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) * fwrite(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<< @@ -10002,16 +10622,33 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":121 + * self.use_sent_id = True + * + * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< + * cdef int word_len + * cdef int num_words + */ + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("cdec.sa._sa.DataArray.write_handle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.DataArray.write_handle", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_word); __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":135 + * fwrite(word, sizeof(char), word_len, f) + * + * def write_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_25write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_25write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -10032,34 +10669,28 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_25write_binary(PyObject *__p return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_24write_binary(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":135 - * fwrite(word, sizeof(char), word_len, f) - * - * def write_binary(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "w") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_24write_binary(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":137 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":137 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< * self.write_handle(f) * fclose(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":138 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":138 * cdef FILE* f * f = fopen(filename, "w") * self.write_handle(f) # <<<<<<<<<<<<<< @@ -10068,7 +10699,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_24write_binary(struct __pyx_ */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":139 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":139 * f = fopen(filename, "w") * self.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -10077,12 +10708,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_24write_binary(struct __pyx_ */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":135 + * fwrite(word, sizeof(char), word_len, f) + * + * def write_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":141 + * fclose(f) + * + * def write_enhanced_handle(self, f): # <<<<<<<<<<<<<< + * for i in self.data: + * f.write("%d " %i) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_27write_enhanced_handle(PyObject *__pyx_v_self, PyObject *__pyx_v_f); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_27write_enhanced_handle(PyObject *__pyx_v_self, PyObject *__pyx_v_f) { @@ -10090,18 +10738,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_27write_enhanced_handle(PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_enhanced_handle (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_f)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":141 - * fclose(f) - * - * def write_enhanced_handle(self, f): # <<<<<<<<<<<<<< - * for i in self.data: - * f.write("%d " %i) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_f) { PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_word = NULL; @@ -10118,7 +10760,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced_handle", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":142 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":142 * * def write_enhanced_handle(self, f): * for i in self.data: # <<<<<<<<<<<<<< @@ -10151,8 +10793,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -10162,45 +10805,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":143 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":143 * def write_enhanced_handle(self, f): * for i in self.data: * f.write("%d " %i) # <<<<<<<<<<<<<< * f.write("\n") * for i in self.sent_index: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __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_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":144 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":144 * for i in self.data: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< * for i in self.sent_index: * f.write("%d " %i) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":145 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":145 * f.write("%d " %i) * f.write("\n") * for i in self.sent_index: # <<<<<<<<<<<<<< @@ -10233,8 +10876,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru } else { __pyx_t_1 = __pyx_t_3(__pyx_t_5); if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -10244,45 +10888,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":146 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":146 * f.write("\n") * for i in self.sent_index: * f.write("%d " %i) # <<<<<<<<<<<<<< * f.write("\n") * for i in self.sent_id: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __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_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":147 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":147 * for i in self.sent_index: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< * for i in self.sent_id: * f.write("%d " %i) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":148 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":148 * f.write("%d " %i) * f.write("\n") * for i in self.sent_id: # <<<<<<<<<<<<<< @@ -10315,8 +10959,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru } else { __pyx_t_5 = __pyx_t_3(__pyx_t_6); if (unlikely(!__pyx_t_5)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -10326,45 +10971,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":149 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":149 * f.write("\n") * for i in self.sent_id: * f.write("%d " %i) # <<<<<<<<<<<<<< * f.write("\n") * for word in self.id2word: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":150 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":150 * for i in self.sent_id: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":151 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":151 * f.write("%d " %i) * f.write("\n") * for word in self.id2word: # <<<<<<<<<<<<<< @@ -10397,8 +11042,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru } else { __pyx_t_6 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_6)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -10408,16 +11054,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":152 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":152 * f.write("\n") * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) # <<<<<<<<<<<<<< * f.write("\n") * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_GetItem(__pyx_v_self->word2id, __pyx_v_word); if (!__pyx_t_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_self->word2id, __pyx_v_word); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); @@ -10427,36 +11073,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_d, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":153 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":153 * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) * f.write("\n") # <<<<<<<<<<<<<< * * def write_enhanced(self, char* filename): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":141 + * fclose(f) + * + * def write_enhanced_handle(self, f): # <<<<<<<<<<<<<< + * for i in self.data: + * f.write("%d " %i) + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -10474,6 +11129,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":155 + * f.write("\n") + * + * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * self.write_enhanced_handle(self, f) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_29write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_29write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -10494,18 +11157,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_29write_enhanced(PyObject *_ return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":155 - * f.write("\n") - * - * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< - * with open(filename, "w") as f: - * self.write_enhanced_handle(self, f) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_r = NULL; @@ -10518,15 +11175,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":156 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":156 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -10534,23 +11191,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py */ /*with:*/ { __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __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)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__w)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_w); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_w); + __Pyx_GIVEREF(__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[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __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 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __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[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __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; @@ -10565,12 +11222,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":157 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":157 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * self.write_enhanced_handle(self, f) # <<<<<<<<<<<<<< */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_29); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_enhanced_handle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); @@ -10580,10 +11237,10 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_1, 1, __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[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __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; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -10595,7 +11252,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":156 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":156 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -10607,36 +11264,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_8 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_10 = PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __pyx_t_11 = ((!(__pyx_t_9 != 0)) != 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_2, __pyx_t_1, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L18; } - __pyx_L18:; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -10657,15 +11303,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py } } /*finally:*/ { - if (__pyx_t_3) { - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_30, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_11 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_3) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__18, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; @@ -10674,6 +11322,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py __pyx_L19:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":155 + * f.write("\n") + * + * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * self.write_enhanced_handle(self, f) + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -10690,6 +11347,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":10 + * + * cdef class DataArray: + * cdef public word2id # <<<<<<<<<<<<<< + * cdef public id2word + * cdef public IntList data + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_1__get__(PyObject *__pyx_v_self) { @@ -10697,18 +11362,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_1__get__(PyObject * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_7word2id___get__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":10 - * - * cdef class DataArray: - * cdef public word2id # <<<<<<<<<<<<<< - * cdef public id2word - * cdef public IntList data - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_7word2id___get__(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -10718,7 +11377,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_7word2id___get__(struct __py __pyx_r = __pyx_v_self->word2id; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -10732,6 +11391,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_3__set__(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_7word2id_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10746,6 +11407,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_7word2id_2__set__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->word2id); __pyx_v_self->word2id = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -10758,6 +11420,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_5__del__(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_7word2id_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10772,11 +11436,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_7word2id_4__del__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->word2id); __pyx_v_self->word2id = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":11 + * cdef class DataArray: + * cdef public word2id + * cdef public id2word # <<<<<<<<<<<<<< + * cdef public IntList data + * cdef public IntList sent_id + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_1__get__(PyObject *__pyx_v_self) { @@ -10784,18 +11457,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_1__get__(PyObject * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_7id2word___get__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":11 - * cdef class DataArray: - * cdef public word2id - * cdef public id2word # <<<<<<<<<<<<<< - * cdef public IntList data - * cdef public IntList sent_id - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_7id2word___get__(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -10805,7 +11472,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_7id2word___get__(struct __py __pyx_r = __pyx_v_self->id2word; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -10819,6 +11486,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_3__set__(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_7id2word_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10833,6 +11502,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_7id2word_2__set__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->id2word); __pyx_v_self->id2word = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -10845,6 +11515,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_5__del__(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_7id2word_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10859,11 +11531,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_7id2word_4__del__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->id2word); __pyx_v_self->id2word = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":12 + * cdef public word2id + * cdef public id2word + * cdef public IntList data # <<<<<<<<<<<<<< + * cdef public IntList sent_id + * cdef public IntList sent_index + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_1__get__(PyObject *__pyx_v_self) { @@ -10871,18 +11552,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_1__get__(PyObject *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_4data___get__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":12 - * cdef public word2id - * cdef public id2word - * cdef public IntList data # <<<<<<<<<<<<<< - * cdef public IntList sent_id - * cdef public IntList sent_index - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_4data___get__(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -10892,7 +11567,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_4data___get__(struct __pyx_o __pyx_r = ((PyObject *)__pyx_v_self->data); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -10906,6 +11581,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_3__set__(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_4data_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10913,20 +11590,25 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_3__set__(PyObject *__pyx_v_s static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_4data_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value) { 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("__set__", 0); if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__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_4cdec_2sa_3_sa_IntList *)__pyx_v_value); + __pyx_v_self->data = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); + __pyx_t_1 = 0; + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.DataArray.data.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -10941,6 +11623,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_5__del__(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_4data_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10955,11 +11639,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_4data_4__del__(struct __pyx_obj_4c __Pyx_DECREF(((PyObject *)__pyx_v_self->data)); __pyx_v_self->data = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":13 + * cdef public id2word + * cdef public IntList data + * cdef public IntList sent_id # <<<<<<<<<<<<<< + * cdef public IntList sent_index + * cdef bint use_sent_id + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_1__get__(PyObject *__pyx_v_self) { @@ -10967,18 +11660,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_1__get__(PyObject * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_7sent_id___get__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":13 - * cdef public id2word - * cdef public IntList data - * cdef public IntList sent_id # <<<<<<<<<<<<<< - * cdef public IntList sent_index - * cdef bint use_sent_id - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_7sent_id___get__(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -10988,7 +11675,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_7sent_id___get__(struct __py __pyx_r = ((PyObject *)__pyx_v_self->sent_id); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -11002,6 +11689,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_3__set__(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_7sent_id_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11009,20 +11698,25 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_3__set__(PyObject *__pyx_ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_7sent_id_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value) { 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("__set__", 0); if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__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_4cdec_2sa_3_sa_IntList *)__pyx_v_value); + __pyx_v_self->sent_id = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); + __pyx_t_1 = 0; + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.DataArray.sent_id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -11037,6 +11731,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_5__del__(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_7sent_id_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11051,11 +11747,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_7sent_id_4__del__(struct __pyx_obj __Pyx_DECREF(((PyObject *)__pyx_v_self->sent_id)); __pyx_v_self->sent_id = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":14 + * cdef public IntList data + * cdef public IntList sent_id + * cdef public IntList sent_index # <<<<<<<<<<<<<< + * cdef bint use_sent_id + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_1__get__(PyObject *__pyx_v_self) { @@ -11063,18 +11768,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_1__get__(PyObje __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_10sent_index___get__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":14 - * cdef public IntList data - * cdef public IntList sent_id - * cdef public IntList sent_index # <<<<<<<<<<<<<< - * cdef bint use_sent_id - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_10sent_index___get__(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -11084,7 +11783,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_10sent_index___get__(struct __pyx_r = ((PyObject *)__pyx_v_self->sent_index); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -11098,6 +11797,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_3__set__(PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_10sent_index_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11105,20 +11806,25 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_3__set__(PyObject *__ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_10sent_index_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value) { 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("__set__", 0); if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__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_4cdec_2sa_3_sa_IntList *)__pyx_v_value); + __pyx_v_self->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); + __pyx_t_1 = 0; + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.DataArray.sent_index.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -11133,6 +11839,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_5__del__(PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9DataArray_10sent_index_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11147,6 +11855,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_10sent_index_4__del__(struct __pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->sent_index)); __pyx_v_self->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -11157,7 +11866,7 @@ static int __pyx_f_4cdec_2sa_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("link", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":16 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":16 * cdef int link(self, int i, int j): * """Integerizes an alignment link pair""" * return i * ALIGNMENT_CODE + j # <<<<<<<<<<<<<< @@ -11167,12 +11876,28 @@ static int __pyx_f_4cdec_2sa_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj __pyx_r = ((__pyx_v_i * __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE) + __pyx_v_j); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":14 + * cdef IntList sent_index + * + * cdef int link(self, int i, int j): # <<<<<<<<<<<<<< + * """Integerizes an alignment link pair""" + * return i * ALIGNMENT_CODE + j + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":18 + * return i * ALIGNMENT_CODE + j + * + * def unlink(self, link): # <<<<<<<<<<<<<< + * """De-integerizes an alignment link pair""" + * return (link / ALIGNMENT_CODE, link % ALIGNMENT_CODE) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_1unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_link); /*proto*/ static char __pyx_doc_4cdec_2sa_3_sa_9Alignment_unlink[] = "De-integerizes an alignment link pair"; @@ -11181,18 +11906,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_1unlink(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unlink (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9Alignment_unlink(((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_link)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":18 - * return i * ALIGNMENT_CODE + j - * - * def unlink(self, link): # <<<<<<<<<<<<<< - * """De-integerizes an alignment link pair""" - * return (link / ALIGNMENT_CODE, link % ALIGNMENT_CODE) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_link) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -11204,7 +11923,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_unlink(CYTHON_UNUSED struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unlink", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":20 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":20 * def unlink(self, link): * """De-integerizes an alignment link pair""" * return (link / ALIGNMENT_CODE, link % ALIGNMENT_CODE) # <<<<<<<<<<<<<< @@ -11212,12 +11931,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_unlink(CYTHON_UNUSED struct * cdef _unlink(self, int link, int* f, int* e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_link, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Remainder(__pyx_v_link, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -11230,12 +11949,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_r = ((PyObject *)__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; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":18 + * return i * ALIGNMENT_CODE + j + * + * def unlink(self, link): # <<<<<<<<<<<<<< + * """De-integerizes an alignment link pair""" + * return (link / ALIGNMENT_CODE, link % ALIGNMENT_CODE) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -11248,7 +11974,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_unlink(CYTHON_UNUSED struct return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":22 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":22 * return (link / ALIGNMENT_CODE, link % ALIGNMENT_CODE) * * cdef _unlink(self, int link, int* f, int* e): # <<<<<<<<<<<<<< @@ -11264,7 +11990,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink(CYTHON_UNUSED struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_unlink", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":23 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":23 * * cdef _unlink(self, int link, int* f, int* e): * f[0] = link / ALIGNMENT_CODE # <<<<<<<<<<<<<< @@ -11275,17 +12001,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink(CYTHON_UNUSED struct #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif {__pyx_filename = __pyx_f[4]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_link))) { + else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_link))) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_OverflowError, "value too large to perform division"); + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif @@ -11293,7 +12019,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink(CYTHON_UNUSED struct } (__pyx_v_f[0]) = __Pyx_div_int(__pyx_v_link, __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":24 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":24 * cdef _unlink(self, int link, int* f, int* e): * f[0] = link / ALIGNMENT_CODE * e[0] = link % ALIGNMENT_CODE # <<<<<<<<<<<<<< @@ -11304,7 +12030,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink(CYTHON_UNUSED struct #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif @@ -11312,6 +12038,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink(CYTHON_UNUSED struct } (__pyx_v_e[0]) = __Pyx_mod_int(__pyx_v_link, __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":22 + * return (link / ALIGNMENT_CODE, link % ALIGNMENT_CODE) + * + * cdef _unlink(self, int link, int* f, int* e): # <<<<<<<<<<<<<< + * f[0] = link / ALIGNMENT_CODE + * e[0] = link % ALIGNMENT_CODE + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -11323,6 +12058,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink(CYTHON_UNUSED struct return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":26 + * e[0] = link % ALIGNMENT_CODE + * + * def get_sent_links(self, int sent_id): # <<<<<<<<<<<<<< + * cdef IntList sent_links + * cdef int* arr + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_3get_sent_links(PyObject *__pyx_v_self, PyObject *__pyx_arg_sent_id); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_3get_sent_links(PyObject *__pyx_v_self, PyObject *__pyx_arg_sent_id) { @@ -11334,7 +12077,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_3get_sent_links(PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_sent_links (wrapper)", 0); assert(__pyx_arg_sent_id); { - __pyx_v_sent_id = __Pyx_PyInt_AsInt(__pyx_arg_sent_id); if (unlikely((__pyx_v_sent_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sent_id = __Pyx_PyInt_As_int(__pyx_arg_sent_id); if (unlikely((__pyx_v_sent_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11343,18 +12086,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_3get_sent_links(PyObject *__ return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)__pyx_v_self), ((int)__pyx_v_sent_id)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":26 - * e[0] = link % ALIGNMENT_CODE - * - * def get_sent_links(self, int sent_id): # <<<<<<<<<<<<<< - * cdef IntList sent_links - * cdef int* arr - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_self, int __pyx_v_sent_id) { struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_sent_links = 0; int *__pyx_v_arr; @@ -11367,19 +12104,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sent_links", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":30 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":30 * cdef int* arr * cdef int arr_len * sent_links = IntList() # <<<<<<<<<<<<<< * 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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_sent_links = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":31 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":31 * cdef int arr_len * sent_links = IntList() * arr = self._get_sent_links(sent_id, &arr_len) # <<<<<<<<<<<<<< @@ -11388,7 +12125,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx */ __pyx_v_arr = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_v_self->__pyx_vtab)->_get_sent_links(__pyx_v_self, __pyx_v_sent_id, (&__pyx_v_arr_len)); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":32 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":32 * sent_links = IntList() * arr = self._get_sent_links(sent_id, &arr_len) * sent_links._extend_arr(arr, arr_len*2) # <<<<<<<<<<<<<< @@ -11397,7 +12134,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_sent_links->__pyx_vtab)->_extend_arr(__pyx_v_sent_links, __pyx_v_arr, (__pyx_v_arr_len * 2)); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":33 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":33 * arr = self._get_sent_links(sent_id, &arr_len) * sent_links._extend_arr(arr, arr_len*2) * free(arr) # <<<<<<<<<<<<<< @@ -11406,7 +12143,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx */ free(__pyx_v_arr); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":34 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":34 * sent_links._extend_arr(arr, arr_len*2) * free(arr) * return sent_links # <<<<<<<<<<<<<< @@ -11418,8 +12155,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx __pyx_r = ((PyObject *)__pyx_v_sent_links); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":26 + * e[0] = link % ALIGNMENT_CODE + * + * def get_sent_links(self, int sent_id): # <<<<<<<<<<<<<< + * cdef IntList sent_links + * cdef int* arr + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.Alignment.get_sent_links", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -11431,7 +12175,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":36 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":36 * return sent_links * * cdef int* _get_sent_links(self, int sent_id, int* num_links): # <<<<<<<<<<<<<< @@ -11453,7 +12197,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_sent_links", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":39 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":39 * cdef int* sent_links * cdef int i, start, end * start = self.sent_index.arr[sent_id] # <<<<<<<<<<<<<< @@ -11462,7 +12206,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4 */ __pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_v_sent_id]); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":40 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":40 * cdef int i, start, end * start = self.sent_index.arr[sent_id] * end = self.sent_index.arr[sent_id+1] # <<<<<<<<<<<<<< @@ -11471,7 +12215,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4 */ __pyx_v_end = (__pyx_v_self->sent_index->arr[(__pyx_v_sent_id + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":41 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":41 * start = self.sent_index.arr[sent_id] * end = self.sent_index.arr[sent_id+1] * num_links[0] = end - start # <<<<<<<<<<<<<< @@ -11480,7 +12224,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4 */ (__pyx_v_num_links[0]) = (__pyx_v_end - __pyx_v_start); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":42 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":42 * end = self.sent_index.arr[sent_id+1] * num_links[0] = end - start * sent_links = malloc(2*num_links[0]*sizeof(int)) # <<<<<<<<<<<<<< @@ -11489,7 +12233,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4 */ __pyx_v_sent_links = ((int *)malloc(((2 * (__pyx_v_num_links[0])) * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":43 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":43 * num_links[0] = end - start * sent_links = malloc(2*num_links[0]*sizeof(int)) * for i from 0 <= i < num_links[0]: # <<<<<<<<<<<<<< @@ -11499,7 +12243,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4 __pyx_t_1 = (__pyx_v_num_links[0]); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":44 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":44 * sent_links = malloc(2*num_links[0]*sizeof(int)) * for i from 0 <= i < num_links[0]: * self._unlink(self.links.arr[start + i], sent_links + (2*i), sent_links + (2*i) + 1) # <<<<<<<<<<<<<< @@ -11511,7 +12255,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":45 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":45 * for i from 0 <= i < num_links[0]: * self._unlink(self.links.arr[start + i], sent_links + (2*i), sent_links + (2*i) + 1) * return sent_links # <<<<<<<<<<<<<< @@ -11521,17 +12265,32 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4 __pyx_r = __pyx_v_sent_links; goto __pyx_L0; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":36 + * return sent_links + * + * cdef int* _get_sent_links(self, int sent_id, int* num_links): # <<<<<<<<<<<<<< + * cdef int* sent_links + * cdef int i, start, end + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_WriteUnraisable("cdec.sa._sa.Alignment._get_sent_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.Alignment._get_sent_links", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":47 + * return sent_links + * + * def __cinit__(self, from_binary=None, from_text=None): # <<<<<<<<<<<<<< + * self.links = IntList(1000,1000) + * self.sent_index = IntList(1000,1000) + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -11544,16 +12303,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_from_binary,&__pyx_n_s_from_text,0}; PyObject* values[2] = {0,0}; - - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":47 - * return sent_links - * - * def __cinit__(self, from_binary=None, from_text=None): # <<<<<<<<<<<<<< - * self.links = IntList(1000,1000) - * self.sent_index = IntList(1000,1000) - */ values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { @@ -11569,12 +12320,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_binary); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_binary); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_text); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_text); if (value) { values[1] = value; kw_args--; } } } @@ -11601,6 +12352,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)__pyx_v_self), __pyx_v_from_binary, __pyx_v_from_text); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11617,14 +12370,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":48 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":48 * * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) # <<<<<<<<<<<<<< * self.sent_index = IntList(1000,1000) * if from_binary: */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->links); @@ -11632,14 +12385,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_ __pyx_v_self->links = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":49 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":49 * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< * if from_binary: * self.read_binary(from_binary) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_k_tuple_32), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sent_index); @@ -11647,7 +12400,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_ __pyx_v_self->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":50 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":50 * self.links = IntList(1000,1000) * self.sent_index = IntList(1000,1000) * if from_binary: # <<<<<<<<<<<<<< @@ -11657,29 +12410,29 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":51 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":51 * self.sent_index = IntList(1000,1000) * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< * elif from_text: * self.read_text(from_text) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__read_binary); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_binary); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 51; __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[4]; __pyx_lineno = 51; __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[4]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 51; __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":52 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":52 * if from_binary: * self.read_binary(from_binary) * elif from_text: # <<<<<<<<<<<<<< @@ -11689,29 +12442,38 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":53 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":53 * self.read_binary(from_binary) * elif from_text: * self.read_text(from_text) # <<<<<<<<<<<<<< * * def read_text(self, char* filename): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 53; __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[4]; __pyx_lineno = 53; __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[4]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 53; __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3; } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":47 + * return sent_links + * + * def __cinit__(self, from_binary=None, from_text=None): # <<<<<<<<<<<<<< + * self.links = IntList(1000,1000) + * self.sent_index = IntList(1000,1000) + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -11725,6 +12487,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":55 + * self.read_text(from_text) + * + * def read_text(self, char* filename): # <<<<<<<<<<<<<< + * with gzip_or_text(filename) as f: + * for line in f: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_7read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_7read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -11745,18 +12515,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_7read_text(PyObject *__pyx_v return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":55 - * self.read_text(from_text) - * - * def read_text(self, char* filename): # <<<<<<<<<<<<<< - * with gzip_or_text(filename) as f: - * for line in f: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_line = NULL; @@ -11776,22 +12540,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); - PyObject *__pyx_t_12 = NULL; + int __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; - PyObject *(*__pyx_t_15)(PyObject *); - int __pyx_t_16; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); int __pyx_t_17; int __pyx_t_18; PyObject *__pyx_t_19 = NULL; int __pyx_t_20; + int __pyx_t_21; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":56 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":56 * * def read_text(self, char* filename): * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -11799,24 +12564,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ * self.sent_index.append(len(self.links)) */ /*with:*/ { - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __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)); + 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[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __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; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_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[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11831,7 +12596,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ __pyx_v_f = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":57 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":57 * def read_text(self, char* filename): * with gzip_or_text(filename) as f: * for line in f: # <<<<<<<<<<<<<< @@ -11864,8 +12629,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -11875,7 +12641,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":58 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":58 * with gzip_or_text(filename) as f: * for line in f: * self.sent_index.append(len(self.links)) # <<<<<<<<<<<<<< @@ -11888,27 +12654,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_2); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":59 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":59 * for line in f: * self.sent_index.append(len(self.links)) * pairs = line.split() # <<<<<<<<<<<<<< * for pair in pairs: * (i, j) = map(int, pair.split('-')) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s__split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_pairs, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_pairs, __pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":60 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":60 * self.sent_index.append(len(self.links)) * pairs = line.split() * for pair in pairs: # <<<<<<<<<<<<<< @@ -11916,67 +12680,68 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ * self.links.append(self.link(i, j)) */ if (PyList_CheckExact(__pyx_v_pairs) || PyTuple_CheckExact(__pyx_v_pairs)) { - __pyx_t_2 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0; - __pyx_t_11 = NULL; + __pyx_t_3 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; + __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext; } for (;;) { - if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break; + if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} #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 = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __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; + } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} #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 = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} #endif } else { - __pyx_t_3 = __pyx_t_11(__pyx_t_2); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_2 = __pyx_t_12(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v_pair, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_pair, __pyx_t_2); + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":61 * pairs = line.split() * for pair in pairs: * (i, j) = map(int, pair.split('-')) # <<<<<<<<<<<<<< * self.links.append(self.link(i, j)) * self.sent_index.append(len(self.links)) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pair, __pyx_n_s__split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_34), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pair, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_12); - __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; + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) { + PyObject* sequence = __pyx_t_13; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else @@ -11989,69 +12754,66 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_13 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_14 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_14); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_13); + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_14); #endif - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else - { + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } 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 = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_15 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_2)) goto __pyx_L20_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_14 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext; - index = 0; __pyx_t_3 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_3)) goto __pyx_L20_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - 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 = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_15 = NULL; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_16 = NULL; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L21_unpacking_done; __pyx_L20_unpacking_failed:; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_16 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L21_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_13); - __pyx_t_13 = 0; + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_14); + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":62 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":62 * for pair in pairs: * (i, j) = map(int, pair.split('-')) * self.links.append(self.link(i, j)) # <<<<<<<<<<<<<< * self.sent_index.append(len(self.links)) * */ - __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 = 62; __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_12 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_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 = 62; __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_v_j); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_13 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_v_self->__pyx_vtab)->link(__pyx_v_self, __pyx_t_17, __pyx_t_18)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->links), __pyx_t_13); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":63 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":63 * (i, j) = map(int, pair.split('-')) * self.links.append(self.link(i, j)) * self.sent_index.append(len(self.links)) # <<<<<<<<<<<<<< @@ -12064,24 +12826,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":56 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":56 * * def read_text(self, char* filename): * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -12090,42 +12850,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ */ /*except:*/ { __Pyx_AddTraceback("cdec.sa._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 = 56; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_13) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_13); - PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_13); - __Pyx_GIVEREF(__pyx_t_13); - __pyx_t_19 = PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); + __pyx_t_14 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_19); - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_19); + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_19); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (__pyx_t_18 < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __pyx_t_20 = ((!(__pyx_t_18 != 0)) != 0); - if (__pyx_t_20) { - __Pyx_GIVEREF(__pyx_t_2); + if (__pyx_t_20 < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_21 = ((!(__pyx_t_20 != 0)) != 0); + if (__pyx_t_21) { __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_13); - __Pyx_ErrRestore(__pyx_t_2, __pyx_t_1, __pyx_t_13); - __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_13 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_13); + __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L24; } - __pyx_L24:; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L8_exception_handled; } @@ -12144,15 +12893,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ } } /*finally:*/ { - if (__pyx_t_4) { - __pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_k_tuple_35, NULL); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_20 < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_4) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__23, NULL); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L25; __pyx_L3_error:; @@ -12161,15 +12912,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ __pyx_L25:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":55 + * self.read_text(from_text) + * + * def read_text(self, char* filename): # <<<<<<<<<<<<<< + * with gzip_or_text(filename) as f: + * for line in f: + */ + + /* function exit code */ __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_3); - __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("cdec.sa._sa.Alignment.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -12184,6 +12944,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":65 + * self.sent_index.append(len(self.links)) + * + * def read_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_9read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_9read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -12204,34 +12972,28 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_9read_binary(PyObject *__pyx return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":65 - * self.sent_index.append(len(self.links)) - * - * def read_binary(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "r") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":67 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":67 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< * self.links.read_handle(f) * self.sent_index.read_handle(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":68 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":68 * cdef FILE* f * f = fopen(filename, "r") * self.links.read_handle(f) # <<<<<<<<<<<<<< @@ -12240,7 +13002,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(struct __pyx_ob */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->read_handle(__pyx_v_self->links, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":69 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":69 * f = fopen(filename, "r") * self.links.read_handle(f) * self.sent_index.read_handle(f) # <<<<<<<<<<<<<< @@ -12249,7 +13011,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(struct __pyx_ob */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":70 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":70 * self.links.read_handle(f) * self.sent_index.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -12258,12 +13020,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(struct __pyx_ob */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":65 + * self.sent_index.append(len(self.links)) + * + * def read_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":72 + * fclose(f) + * + * def write_text(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * sent_num = 0 + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_11write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_11write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -12284,18 +13063,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_11write_text(PyObject *__pyx return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":72 - * fclose(f) - * - * def write_text(self, char* filename): # <<<<<<<<<<<<<< - * with open(filename, "w") as f: - * sent_num = 0 - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_sent_num = NULL; @@ -12323,7 +13096,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":73 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12332,23 +13105,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob */ /*with:*/ { __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __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)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__w)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_w); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_w); + __Pyx_GIVEREF(__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[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __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 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __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[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __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; @@ -12363,7 +13136,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":74 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":74 * def write_text(self, char* filename): * with open(filename, "w") as f: * sent_num = 0 # <<<<<<<<<<<<<< @@ -12373,7 +13146,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob __Pyx_INCREF(__pyx_int_0); __pyx_v_sent_num = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":75 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":75 * with open(filename, "w") as f: * sent_num = 0 * for i, link in enumerate(self.links): # <<<<<<<<<<<<<< @@ -12408,8 +13181,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -12426,7 +13200,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob __pyx_t_4 = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":76 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":76 * sent_num = 0 * for i, link in enumerate(self.links): * while i >= self.sent_index[sent_num]: # <<<<<<<<<<<<<< @@ -12434,7 +13208,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob * sent_num = sent_num + 1 */ while (1) { - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self->sent_index), __pyx_v_sent_num); if (!__pyx_t_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self->sent_index), __pyx_v_sent_num); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12442,21 +13216,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (!__pyx_t_11) break; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":77 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":77 * for i, link in enumerate(self.links): * while i >= self.sent_index[sent_num]: * f.write("\n") # <<<<<<<<<<<<<< * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":78 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":78 * while i >= self.sent_index[sent_num]: * f.write("\n") * sent_num = sent_num + 1 # <<<<<<<<<<<<<< @@ -12469,53 +13243,53 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":79 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":79 * f.write("\n") * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) # <<<<<<<<<<<<<< * f.write("\n") * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__unlink); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_link); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_link); __Pyx_GIVEREF(__pyx_v_link); - __pyx_t_13 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_37), __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyString_Format(__pyx_kp_s_d_d, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_13); - PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":80 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":80 * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) * f.write("\n") # <<<<<<<<<<<<<< * * def write_binary(self, char* filename): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12532,7 +13306,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":73 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12545,19 +13319,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_13 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_13); - __Pyx_INCREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_14 = PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_14); @@ -12567,14 +13333,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_1, __pyx_t_4, __pyx_t_12); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_12 = 0; {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L22; } - __pyx_L22:; - __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -12595,15 +13358,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob } } /*finally:*/ { - if (__pyx_t_3) { - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_39, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_15 < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_3) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__26, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L23; __pyx_L3_error:; @@ -12612,6 +13377,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob __pyx_L23:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":72 + * fclose(f) + * + * def write_text(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * sent_num = 0 + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -12633,6 +13407,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":82 + * f.write("\n") + * + * def write_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_13write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_13write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -12653,34 +13435,28 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_13write_binary(PyObject *__p return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":82 - * f.write("\n") - * - * def write_binary(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "w") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":84 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":84 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< * self.links.write_handle(f) * self.sent_index.write_handle(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":85 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":85 * cdef FILE* f * f = fopen(filename, "w") * self.links.write_handle(f) # <<<<<<<<<<<<<< @@ -12689,7 +13465,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(struct __pyx_ */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->write_handle(__pyx_v_self->links, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":86 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":86 * f = fopen(filename, "w") * self.links.write_handle(f) * self.sent_index.write_handle(f) # <<<<<<<<<<<<<< @@ -12698,7 +13474,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(struct __pyx_ */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":87 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":87 * self.links.write_handle(f) * self.sent_index.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -12707,12 +13483,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(struct __pyx_ */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":82 + * f.write("\n") + * + * def write_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":89 + * fclose(f) + * + * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * for link in self.links: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_15write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_15write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -12733,18 +13526,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_15write_enhanced(PyObject *_ return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":89 - * fclose(f) - * - * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< - * with open(filename, "w") as f: - * for link in self.links: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_link = NULL; @@ -12761,15 +13548,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; - PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":90 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":90 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12778,23 +13565,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py */ /*with:*/ { __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __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)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__w)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_w); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_w); + __Pyx_GIVEREF(__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[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __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 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __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[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __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; @@ -12809,7 +13596,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":91 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":91 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * for link in self.links: # <<<<<<<<<<<<<< @@ -12842,8 +13629,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -12853,45 +13641,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":92 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":92 * with open(filename, "w") as f: * for link in self.links: * f.write("%d " % link) # <<<<<<<<<<<<<< * f.write("\n") * for i in self.sent_index: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_v_link); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_v_link); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":93 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":93 * for link in self.links: * f.write("%d " % link) * f.write("\n") # <<<<<<<<<<<<<< * for i in self.sent_index: * f.write("%d " % i) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":94 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":94 * f.write("%d " % link) * f.write("\n") * for i in self.sent_index: # <<<<<<<<<<<<<< @@ -12924,8 +13712,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py } else { __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -12935,40 +13724,40 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":95 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":95 * f.write("\n") * for i in self.sent_index: * f.write("%d " % i) # <<<<<<<<<<<<<< * f.write("\n") * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); + __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 95; __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)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":96 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":96 * for i in self.sent_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< * * def alignment(self, i): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -12983,7 +13772,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":90 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":90 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12996,36 +13785,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_4 = PyTuple_Pack(3, __pyx_t_10, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_12 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __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 (__pyx_t_11 < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __pyx_t_13 = ((!(__pyx_t_11 != 0)) != 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_12 < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_2, __pyx_t_1); __pyx_t_10 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L22; } - __pyx_L22:; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __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; @@ -13046,15 +13824,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py } } /*finally:*/ { - if (__pyx_t_3) { - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_42, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __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 (__pyx_t_13 < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_3) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L23; __pyx_L3_error:; @@ -13063,6 +13843,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py __pyx_L23:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":89 + * fclose(f) + * + * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * for link in self.links: + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -13081,6 +13870,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":98 + * f.write("\n") + * + * def alignment(self, i): # <<<<<<<<<<<<<< + * """Return all (e,f) pairs for sentence i""" + * cdef int j, start, end + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_17alignment(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static char __pyx_doc_4cdec_2sa_3_sa_9Alignment_16alignment[] = "Return all (e,f) pairs for sentence i"; @@ -13089,18 +13886,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9Alignment_17alignment(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("alignment (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":98 - * f.write("\n") - * - * def alignment(self, i): # <<<<<<<<<<<<<< - * """Return all (e,f) pairs for sentence i""" - * cdef int j, start, end - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_i) { int __pyx_v_j; int __pyx_v_start; @@ -13119,7 +13910,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("alignment", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":101 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":101 * """Return all (e,f) pairs for sentence i""" * cdef int j, start, end * result = [] # <<<<<<<<<<<<<< @@ -13131,7 +13922,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":102 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":102 * cdef int j, start, end * result = [] * start = self.sent_index.arr[i] # <<<<<<<<<<<<<< @@ -13141,7 +13932,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_t_2]); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":103 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":103 * result = [] * start = self.sent_index.arr[i] * end = self.sent_index.arr[i+1] # <<<<<<<<<<<<<< @@ -13154,7 +13945,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_end = (__pyx_v_self->sent_index->arr[__pyx_t_2]); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":104 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":104 * start = self.sent_index.arr[i] * end = self.sent_index.arr[i+1] * for j from start <= j < end: # <<<<<<<<<<<<<< @@ -13164,41 +13955,48 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj __pyx_t_3 = __pyx_v_end; for (__pyx_v_j = __pyx_v_start; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":105 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":105 * end = self.sent_index.arr[i+1] * for j from start <= j < end: * result.append(self.unlink(self.links.arr[j])) # <<<<<<<<<<<<<< * return result */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__unlink); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyInt_FromLong((__pyx_v_self->links->arr[__pyx_v_j])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->links->arr[__pyx_v_j])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 105; __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_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":106 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":106 * for j from start <= j < end: * result.append(self.unlink(self.links.arr[j])) * return result # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":98 + * f.write("\n") + * + * def alignment(self, i): # <<<<<<<<<<<<<< + * """Return all (e,f) pairs for sentence i""" + * cdef int j, start, end + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); @@ -13212,7 +14010,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":15 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":15 * int val * * cdef _node* new_node(int key): # <<<<<<<<<<<<<< @@ -13226,7 +14024,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_node", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":17 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":17 * cdef _node* new_node(int key): * cdef _node* n * n = <_node*> malloc(sizeof(_node)) # <<<<<<<<<<<<<< @@ -13235,7 +14033,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int */ __pyx_v_n = ((struct __pyx_t_4cdec_2sa_3_sa__node *)malloc((sizeof(struct __pyx_t_4cdec_2sa_3_sa__node)))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":18 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":18 * cdef _node* n * n = <_node*> malloc(sizeof(_node)) * n.smaller = NULL # <<<<<<<<<<<<<< @@ -13244,7 +14042,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int */ __pyx_v_n->smaller = NULL; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":19 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":19 * n = <_node*> malloc(sizeof(_node)) * n.smaller = NULL * n.bigger = NULL # <<<<<<<<<<<<<< @@ -13253,7 +14051,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int */ __pyx_v_n->bigger = NULL; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":20 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":20 * n.smaller = NULL * n.bigger = NULL * n.key = key # <<<<<<<<<<<<<< @@ -13262,7 +14060,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int */ __pyx_v_n->key = __pyx_v_key; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":21 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":21 * n.bigger = NULL * n.key = key * n.val = 0 # <<<<<<<<<<<<<< @@ -13271,7 +14069,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int */ __pyx_v_n->val = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":22 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":22 * n.key = key * n.val = 0 * return n # <<<<<<<<<<<<<< @@ -13281,13 +14079,21 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int __pyx_r = __pyx_v_n; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":15 + * int val + * + * cdef _node* new_node(int key): # <<<<<<<<<<<<<< + * cdef _node* n + * n = <_node*> malloc(sizeof(_node)) + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":25 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":25 * * * cdef del_node(_node* n): # <<<<<<<<<<<<<< @@ -13305,7 +14111,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("del_node", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":26 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":26 * * cdef del_node(_node* n): * if n.smaller != NULL: # <<<<<<<<<<<<<< @@ -13315,7 +14121,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__ __pyx_t_1 = ((__pyx_v_n->smaller != NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":27 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":27 * cdef del_node(_node* n): * if n.smaller != NULL: * del_node(n.smaller) # <<<<<<<<<<<<<< @@ -13329,7 +14135,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__ } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":28 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":28 * if n.smaller != NULL: * del_node(n.smaller) * if n.bigger != NULL: # <<<<<<<<<<<<<< @@ -13339,7 +14145,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__ __pyx_t_1 = ((__pyx_v_n->bigger != NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":29 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":29 * del_node(n.smaller) * if n.bigger != NULL: * del_node(n.bigger) # <<<<<<<<<<<<<< @@ -13353,7 +14159,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__ } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":30 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":30 * if n.bigger != NULL: * del_node(n.bigger) * free(n) # <<<<<<<<<<<<<< @@ -13362,6 +14168,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__ */ free(__pyx_v_n); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":25 + * + * + * cdef del_node(_node* n): # <<<<<<<<<<<<<< + * if n.smaller != NULL: + * del_node(n.smaller) + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -13374,7 +14189,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__ return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":32 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":32 * free(n) * * cdef int* get_val(_node* n, int key): # <<<<<<<<<<<<<< @@ -13388,7 +14203,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * int __pyx_t_1; __Pyx_RefNannySetupContext("get_val", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":33 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":33 * * cdef int* get_val(_node* n, int key): * if key == n.key: # <<<<<<<<<<<<<< @@ -13398,7 +14213,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * __pyx_t_1 = ((__pyx_v_key == __pyx_v_n->key) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":34 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":34 * cdef int* get_val(_node* n, int key): * if key == n.key: * return &n.val # <<<<<<<<<<<<<< @@ -13407,10 +14222,9 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * */ __pyx_r = (&__pyx_v_n->val); goto __pyx_L0; - goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":35 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":35 * if key == n.key: * return &n.val * elif key < n.key: # <<<<<<<<<<<<<< @@ -13420,7 +14234,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * __pyx_t_1 = ((__pyx_v_key < __pyx_v_n->key) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":36 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":36 * return &n.val * elif key < n.key: * if n.smaller == NULL: # <<<<<<<<<<<<<< @@ -13430,7 +14244,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * __pyx_t_1 = ((__pyx_v_n->smaller == NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":37 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":37 * elif key < n.key: * if n.smaller == NULL: * n.smaller = new_node(key) # <<<<<<<<<<<<<< @@ -13439,7 +14253,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * */ __pyx_v_n->smaller = __pyx_f_4cdec_2sa_3_sa_new_node(__pyx_v_key); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":38 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":38 * if n.smaller == NULL: * n.smaller = new_node(key) * return &(n.smaller.val) # <<<<<<<<<<<<<< @@ -13448,11 +14262,9 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * */ __pyx_r = (&__pyx_v_n->smaller->val); goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":39 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":39 * n.smaller = new_node(key) * return &(n.smaller.val) * return get_val(n.smaller, key) # <<<<<<<<<<<<<< @@ -13461,11 +14273,10 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * */ __pyx_r = __pyx_f_4cdec_2sa_3_sa_get_val(__pyx_v_n->smaller, __pyx_v_key); goto __pyx_L0; - goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":41 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":41 * return get_val(n.smaller, key) * else: * if n.bigger == NULL: # <<<<<<<<<<<<<< @@ -13475,7 +14286,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * __pyx_t_1 = ((__pyx_v_n->bigger == NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":42 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":42 * else: * if n.bigger == NULL: * n.bigger = new_node(key) # <<<<<<<<<<<<<< @@ -13484,7 +14295,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * */ __pyx_v_n->bigger = __pyx_f_4cdec_2sa_3_sa_new_node(__pyx_v_key); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":43 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":43 * if n.bigger == NULL: * n.bigger = new_node(key) * return &(n.bigger.val) # <<<<<<<<<<<<<< @@ -13493,11 +14304,9 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * */ __pyx_r = (&__pyx_v_n->bigger->val); goto __pyx_L0; - goto __pyx_L5; } - __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":44 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":44 * n.bigger = new_node(key) * return &(n.bigger.val) * return get_val(n.bigger, key) # <<<<<<<<<<<<<< @@ -13507,14 +14316,29 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node * __pyx_r = __pyx_f_4cdec_2sa_3_sa_get_val(__pyx_v_n->bigger, __pyx_v_key); goto __pyx_L0; } - __pyx_L3:; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":32 + * free(n) + * + * cdef int* get_val(_node* n, int key): # <<<<<<<<<<<<<< + * if key == n.key: + * return &n.val + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":54 + * cdef id2eword, id2fword, eword2id, fword2id + * + * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< + * earray=None, fsarray=None, alignment=None): + * self.id2eword = [] + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -13531,21 +14355,13 @@ static int __pyx_pw_4cdec_2sa_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyO __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}; + 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}; - - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":54 - * cdef id2eword, id2fword, eword2id, fword2id - * - * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< - * earray=None, fsarray=None, alignment=None): - * self.id2eword = [] - */ values[0] = ((PyObject *)Py_None); - values[1] = __pyx_k_43; + values[1] = ((PyObject *)Py_False); values[2] = ((PyObject *)Py_None); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":55 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":55 * * def __cinit__(self, from_text=None, from_data=False, from_binary=None, * earray=None, fsarray=None, alignment=None): # <<<<<<<<<<<<<< @@ -13572,32 +14388,32 @@ static int __pyx_pw_4cdec_2sa_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyO switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_text); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_text); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_data); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_data); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_binary); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_binary); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__earray); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_earray); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fsarray); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alignment); if (value) { values[5] = value; kw_args--; } } } @@ -13632,11 +14448,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyO return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(((struct __pyx_obj_4cdec_2sa_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; -} -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":54 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":54 * cdef id2eword, id2fword, eword2id, fword2id * * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< @@ -13644,6 +14457,11 @@ static int __pyx_pw_4cdec_2sa_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyO * self.id2eword = [] */ + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_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 @@ -13656,7 +14474,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":56 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":56 * def __cinit__(self, from_text=None, from_data=False, from_binary=None, * earray=None, fsarray=None, alignment=None): * self.id2eword = [] # <<<<<<<<<<<<<< @@ -13665,13 +14483,13 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->id2eword); __Pyx_DECREF(__pyx_v_self->id2eword); - __pyx_v_self->id2eword = ((PyObject *)__pyx_t_1); + __pyx_v_self->id2eword = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":57 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":57 * earray=None, fsarray=None, alignment=None): * self.id2eword = [] * self.id2fword = [] # <<<<<<<<<<<<<< @@ -13680,13 +14498,13 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->id2fword); __Pyx_DECREF(__pyx_v_self->id2fword); - __pyx_v_self->id2fword = ((PyObject *)__pyx_t_1); + __pyx_v_self->id2fword = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":58 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":58 * self.id2eword = [] * self.id2fword = [] * self.eword2id = {} # <<<<<<<<<<<<<< @@ -13694,14 +14512,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 * self.e_index = IntList() */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->eword2id); __Pyx_DECREF(__pyx_v_self->eword2id); - __pyx_v_self->eword2id = ((PyObject *)__pyx_t_1); + __pyx_v_self->eword2id = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":59 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":59 * self.id2fword = [] * self.eword2id = {} * self.fword2id = {} # <<<<<<<<<<<<<< @@ -13709,21 +14527,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 * self.f_index = IntList() */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->fword2id); __Pyx_DECREF(__pyx_v_self->fword2id); - __pyx_v_self->fword2id = ((PyObject *)__pyx_t_1); + __pyx_v_self->fword2id = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":60 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":60 * self.eword2id = {} * self.fword2id = {} * self.e_index = IntList() # <<<<<<<<<<<<<< * self.f_index = IntList() * self.col1 = FloatList() */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_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_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __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); @@ -13731,14 +14549,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 __pyx_v_self->e_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":61 * self.fword2id = {} * self.e_index = IntList() * self.f_index = IntList() # <<<<<<<<<<<<<< * self.col1 = FloatList() * self.col2 = FloatList() */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_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_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __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); @@ -13746,14 +14564,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 __pyx_v_self->f_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":62 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":62 * self.e_index = IntList() * self.f_index = IntList() * self.col1 = FloatList() # <<<<<<<<<<<<<< * self.col2 = FloatList() * if from_binary: */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_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_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), __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); @@ -13761,14 +14579,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 __pyx_v_self->col1 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":63 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":63 * self.f_index = IntList() * self.col1 = FloatList() * self.col2 = FloatList() # <<<<<<<<<<<<<< * if from_binary: * self.read_binary(from_binary) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_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_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), __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); @@ -13776,7 +14594,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 __pyx_v_self->col2 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":64 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":64 * self.col1 = FloatList() * self.col2 = FloatList() * if from_binary: # <<<<<<<<<<<<<< @@ -13786,29 +14604,29 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":65 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":65 * self.col2 = FloatList() * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< * elif from_data: * self.compute_from_data(fsarray, earray, alignment) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__read_binary); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_binary); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __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[5]; __pyx_lineno = 65; __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[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":66 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":66 * if from_binary: * self.read_binary(from_binary) * elif from_data: # <<<<<<<<<<<<<< @@ -13818,7 +14636,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_data); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":67 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":67 * self.read_binary(from_binary) * elif from_data: * self.compute_from_data(fsarray, earray, alignment) # <<<<<<<<<<<<<< @@ -13835,28 +14653,37 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":69 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":69 * self.compute_from_data(fsarray, earray, alignment) * else: * self.read_text(from_text) # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; __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[5]; __pyx_lineno = 69; __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[5]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":54 + * cdef id2eword, id2fword, eword2id, fword2id + * + * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< + * earray=None, fsarray=None, alignment=None): + * self.id2eword = [] + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -13870,7 +14697,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3 return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":72 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":72 * * * cdef compute_from_data(self, SuffixArray fsa, DataArray eda, Alignment aa): # <<<<<<<<<<<<<< @@ -13910,21 +14737,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; + int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compute_from_data", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":79 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":79 * cdef int null_word * * null_word = 0 # <<<<<<<<<<<<<< @@ -13933,7 +14761,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_null_word = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":80 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":80 * * null_word = 0 * for word in fsa.darray.id2word: # I miss list comprehensions # <<<<<<<<<<<<<< @@ -13966,8 +14794,9 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -13977,29 +14806,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":81 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":81 * null_word = 0 * for word in fsa.darray.id2word: # I miss list comprehensions * self.id2fword.append(word) # <<<<<<<<<<<<<< * self.id2fword[null_word] = "NULL" * for id, word in enumerate(self.id2fword): */ - __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_self->id2fword, __pyx_v_word); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2fword, __pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":82 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":82 * for word in fsa.darray.id2word: # I miss list comprehensions * self.id2fword.append(word) * self.id2fword[null_word] = "NULL" # <<<<<<<<<<<<<< * for id, word in enumerate(self.id2fword): * self.fword2id[word] = id */ - if (__Pyx_SetItemInt(__pyx_v_self->id2fword, __pyx_v_null_word, ((PyObject *)__pyx_n_s__NULL), sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_SetItemInt(__pyx_v_self->id2fword, __pyx_v_null_word, __pyx_n_s_NULL, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":83 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":83 * self.id2fword.append(word) * self.id2fword[null_word] = "NULL" * for id, word in enumerate(self.id2fword): # <<<<<<<<<<<<<< @@ -14020,51 +14847,52 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_5 = __pyx_t_3(__pyx_t_4); - if (unlikely(!__pyx_t_5)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_6 = __pyx_t_3(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); } - __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_6); + __pyx_t_6 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_id, __pyx_t_1); - __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); - __pyx_t_1 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":84 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":84 * self.id2fword[null_word] = "NULL" * for id, word in enumerate(self.id2fword): * self.fword2id[word] = id # <<<<<<<<<<<<<< * * for word in eda.id2word: */ - if (PyObject_SetItem(__pyx_v_self->fword2id, __pyx_v_word, __pyx_v_id) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyObject_SetItem(__pyx_v_self->fword2id, __pyx_v_word, __pyx_v_id) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":86 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":86 * self.fword2id[word] = id * * for word in eda.id2word: # <<<<<<<<<<<<<< @@ -14097,8 +14925,9 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -14108,29 +14937,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":87 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":87 * * for word in eda.id2word: * self.id2eword.append(word) # <<<<<<<<<<<<<< * self.id2eword[null_word] = "NULL" * for id, word in enumerate(self.id2eword): */ - __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_self->id2eword, __pyx_v_word); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2eword, __pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":88 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":88 * for word in eda.id2word: * self.id2eword.append(word) * self.id2eword[null_word] = "NULL" # <<<<<<<<<<<<<< * for id, word in enumerate(self.id2eword): * self.eword2id[word] = id */ - if (__Pyx_SetItemInt(__pyx_v_self->id2eword, __pyx_v_null_word, ((PyObject *)__pyx_n_s__NULL), sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_SetItemInt(__pyx_v_self->id2eword, __pyx_v_null_word, __pyx_n_s_NULL, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":89 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":89 * self.id2eword.append(word) * self.id2eword[null_word] = "NULL" * for id, word in enumerate(self.id2eword): # <<<<<<<<<<<<<< @@ -14151,51 +14978,52 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_5 = __pyx_t_3(__pyx_t_4); - if (unlikely(!__pyx_t_5)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_6 = __pyx_t_3(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); } - __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_6); + __pyx_t_6 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_id, __pyx_t_1); - __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); - __pyx_t_1 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":90 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":90 * self.id2eword[null_word] = "NULL" * for id, word in enumerate(self.id2eword): * self.eword2id[word] = id # <<<<<<<<<<<<<< * * num_pairs = 0 */ - if (PyObject_SetItem(__pyx_v_self->eword2id, __pyx_v_word, __pyx_v_id) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyObject_SetItem(__pyx_v_self->eword2id, __pyx_v_word, __pyx_v_id) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":92 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":92 * self.eword2id[word] = id * * num_pairs = 0 # <<<<<<<<<<<<<< @@ -14204,7 +15032,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_num_pairs = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":94 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":94 * num_pairs = 0 * * V_E = len(eda.id2word) # <<<<<<<<<<<<<< @@ -14217,7 +15045,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_V_E = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":95 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":95 * * V_E = len(eda.id2word) * V_F = len(fsa.darray.id2word) # <<<<<<<<<<<<<< @@ -14230,7 +15058,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_V_F = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":96 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":96 * V_E = len(eda.id2word) * V_F = len(fsa.darray.id2word) * fmargin = malloc(V_F*sizeof(int)) # <<<<<<<<<<<<<< @@ -14239,7 +15067,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_fmargin = ((int *)malloc((__pyx_v_V_F * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":97 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":97 * V_F = len(fsa.darray.id2word) * fmargin = malloc(V_F*sizeof(int)) * emargin = malloc(V_E*sizeof(int)) # <<<<<<<<<<<<<< @@ -14248,7 +15076,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_emargin = ((int *)malloc((__pyx_v_V_E * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":98 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":98 * fmargin = malloc(V_F*sizeof(int)) * emargin = malloc(V_E*sizeof(int)) * memset(fmargin, 0, V_F*sizeof(int)) # <<<<<<<<<<<<<< @@ -14257,7 +15085,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ memset(__pyx_v_fmargin, 0, (__pyx_v_V_F * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":99 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":99 * emargin = malloc(V_E*sizeof(int)) * memset(fmargin, 0, V_F*sizeof(int)) * memset(emargin, 0, V_E*sizeof(int)) # <<<<<<<<<<<<<< @@ -14266,7 +15094,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ memset(__pyx_v_emargin, 0, (__pyx_v_V_E * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":101 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":101 * memset(emargin, 0, V_E*sizeof(int)) * * dict = <_node**> malloc(V_F*sizeof(_node*)) # <<<<<<<<<<<<<< @@ -14275,7 +15103,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_dict = ((struct __pyx_t_4cdec_2sa_3_sa__node **)malloc((__pyx_v_V_F * (sizeof(struct __pyx_t_4cdec_2sa_3_sa__node *))))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":102 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":102 * * dict = <_node**> malloc(V_F*sizeof(_node*)) * memset(dict, 0, V_F*sizeof(_node*)) # <<<<<<<<<<<<<< @@ -14284,7 +15112,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ memset(__pyx_v_dict, 0, (__pyx_v_V_F * (sizeof(struct __pyx_t_4cdec_2sa_3_sa__node *)))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":104 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":104 * memset(dict, 0, V_F*sizeof(_node*)) * * num_sents = len(fsa.darray.sent_index) # <<<<<<<<<<<<<< @@ -14300,7 +15128,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob __pyx_v_num_sents = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":105 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":105 * * num_sents = len(fsa.darray.sent_index) * for sent_id from 0 <= sent_id < num_sents-1: # <<<<<<<<<<<<<< @@ -14309,11 +15137,11 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_t_1 = PyNumber_Subtract(__pyx_v_num_sents, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (__pyx_v_sent_id = 0; __pyx_v_sent_id < __pyx_t_6; __pyx_v_sent_id++) { + for (__pyx_v_sent_id = 0; __pyx_v_sent_id < __pyx_t_7; __pyx_v_sent_id++) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":107 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":107 * for sent_id from 0 <= sent_id < num_sents-1: * * fsent = fsa.darray.data.arr + fsa.darray.sent_index.arr[sent_id] # <<<<<<<<<<<<<< @@ -14322,7 +15150,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_fsent = (__pyx_v_fsa->darray->data->arr + (__pyx_v_fsa->darray->sent_index->arr[__pyx_v_sent_id])); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":108 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":108 * * fsent = fsa.darray.data.arr + fsa.darray.sent_index.arr[sent_id] * I = fsa.darray.sent_index.arr[sent_id+1] - fsa.darray.sent_index.arr[sent_id] - 1 # <<<<<<<<<<<<<< @@ -14331,7 +15159,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_I = (((__pyx_v_fsa->darray->sent_index->arr[(__pyx_v_sent_id + 1)]) - (__pyx_v_fsa->darray->sent_index->arr[__pyx_v_sent_id])) - 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":109 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":109 * fsent = fsa.darray.data.arr + fsa.darray.sent_index.arr[sent_id] * I = fsa.darray.sent_index.arr[sent_id+1] - fsa.darray.sent_index.arr[sent_id] - 1 * faligned = malloc(I*sizeof(int)) # <<<<<<<<<<<<<< @@ -14340,7 +15168,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_faligned = ((int *)malloc((__pyx_v_I * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":110 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":110 * I = fsa.darray.sent_index.arr[sent_id+1] - fsa.darray.sent_index.arr[sent_id] - 1 * faligned = malloc(I*sizeof(int)) * memset(faligned, 0, I*sizeof(int)) # <<<<<<<<<<<<<< @@ -14349,7 +15177,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ memset(__pyx_v_faligned, 0, (__pyx_v_I * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":112 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":112 * memset(faligned, 0, I*sizeof(int)) * * esent = eda.data.arr + eda.sent_index.arr[sent_id] # <<<<<<<<<<<<<< @@ -14358,7 +15186,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_esent = (__pyx_v_eda->data->arr + (__pyx_v_eda->sent_index->arr[__pyx_v_sent_id])); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":113 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":113 * * esent = eda.data.arr + eda.sent_index.arr[sent_id] * J = eda.sent_index.arr[sent_id+1] - eda.sent_index.arr[sent_id] - 1 # <<<<<<<<<<<<<< @@ -14367,7 +15195,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_J = (((__pyx_v_eda->sent_index->arr[(__pyx_v_sent_id + 1)]) - (__pyx_v_eda->sent_index->arr[__pyx_v_sent_id])) - 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":114 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":114 * esent = eda.data.arr + eda.sent_index.arr[sent_id] * J = eda.sent_index.arr[sent_id+1] - eda.sent_index.arr[sent_id] - 1 * ealigned = malloc(J*sizeof(int)) # <<<<<<<<<<<<<< @@ -14376,7 +15204,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_ealigned = ((int *)malloc((__pyx_v_J * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":115 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":115 * J = eda.sent_index.arr[sent_id+1] - eda.sent_index.arr[sent_id] - 1 * ealigned = malloc(J*sizeof(int)) * memset(ealigned, 0, J*sizeof(int)) # <<<<<<<<<<<<<< @@ -14385,7 +15213,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ memset(__pyx_v_ealigned, 0, (__pyx_v_J * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":117 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":117 * memset(ealigned, 0, J*sizeof(int)) * * links = aa._get_sent_links(sent_id, &num_links) # <<<<<<<<<<<<<< @@ -14394,17 +15222,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_links = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_v_aa->__pyx_vtab)->_get_sent_links(__pyx_v_aa, __pyx_v_sent_id, (&__pyx_v_num_links)); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":119 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":119 * links = aa._get_sent_links(sent_id, &num_links) * * for l from 0 <= l < num_links: # <<<<<<<<<<<<<< * i = links[l*2] * j = links[l*2+1] */ - __pyx_t_7 = __pyx_v_num_links; - for (__pyx_v_l = 0; __pyx_v_l < __pyx_t_7; __pyx_v_l++) { + __pyx_t_8 = __pyx_v_num_links; + for (__pyx_v_l = 0; __pyx_v_l < __pyx_t_8; __pyx_v_l++) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":120 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":120 * * for l from 0 <= l < num_links: * i = links[l*2] # <<<<<<<<<<<<<< @@ -14413,7 +15241,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_i = (__pyx_v_links[(__pyx_v_l * 2)]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":121 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":121 * for l from 0 <= l < num_links: * i = links[l*2] * j = links[l*2+1] # <<<<<<<<<<<<<< @@ -14422,75 +15250,73 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_j = (__pyx_v_links[((__pyx_v_l * 2) + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":122 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":122 * i = links[l*2] * j = links[l*2+1] * if i >= I or j >= J: # <<<<<<<<<<<<<< * raise Exception("%d-%d out of bounds (I=%d,J=%d) in line %d\n" % (i,j,I,J,sent_id+1)) * f_i = fsent[i] */ - __pyx_t_8 = ((__pyx_v_i >= __pyx_v_I) != 0); - if (!__pyx_t_8) { - __pyx_t_9 = ((__pyx_v_j >= __pyx_v_J) != 0); - __pyx_t_10 = __pyx_t_9; + __pyx_t_9 = ((__pyx_v_i >= __pyx_v_I) != 0); + if (!__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_j >= __pyx_v_J) != 0); + __pyx_t_11 = __pyx_t_10; } else { - __pyx_t_10 = __pyx_t_8; + __pyx_t_11 = __pyx_t_9; } - if (__pyx_t_10) { + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":123 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":123 * j = links[l*2+1] * if i >= I or j >= J: * raise Exception("%d-%d out of bounds (I=%d,J=%d) in line %d\n" % (i,j,I,J,sent_id+1)) # <<<<<<<<<<<<<< * f_i = fsent[i] * e_j = esent[j] */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyInt_FromLong(__pyx_v_I); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = PyInt_FromLong(__pyx_v_J); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyInt_FromLong((__pyx_v_sent_id + 1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = PyTuple_New(5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyInt_From_long((__pyx_v_sent_id + 1)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); + __pyx_t_14 = PyTuple_New(5); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); __pyx_t_1 = 0; __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_11 = 0; + __pyx_t_6 = 0; __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_44), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; - __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyString_Format(__pyx_kp_s_d_d_out_of_bounds_I_d_J_d_in_li, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); - __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; - __Pyx_Raise(__pyx_t_12, 0, 0, 0); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_13, 0, 0, 0); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L15; } - __pyx_L15:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":124 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":124 * if i >= I or j >= J: * raise Exception("%d-%d out of bounds (I=%d,J=%d) in line %d\n" % (i,j,I,J,sent_id+1)) * f_i = fsent[i] # <<<<<<<<<<<<<< @@ -14499,7 +15325,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_f_i = (__pyx_v_fsent[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":125 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":125 * raise Exception("%d-%d out of bounds (I=%d,J=%d) in line %d\n" % (i,j,I,J,sent_id+1)) * f_i = fsent[i] * e_j = esent[j] # <<<<<<<<<<<<<< @@ -14508,7 +15334,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_e_j = (__pyx_v_esent[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":126 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":126 * f_i = fsent[i] * e_j = esent[j] * fmargin[f_i] = fmargin[f_i]+1 # <<<<<<<<<<<<<< @@ -14517,7 +15343,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_fmargin[__pyx_v_f_i]) = ((__pyx_v_fmargin[__pyx_v_f_i]) + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":127 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":127 * e_j = esent[j] * fmargin[f_i] = fmargin[f_i]+1 * emargin[e_j] = emargin[e_j]+1 # <<<<<<<<<<<<<< @@ -14526,17 +15352,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_emargin[__pyx_v_e_j]) = ((__pyx_v_emargin[__pyx_v_e_j]) + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":128 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":128 * fmargin[f_i] = fmargin[f_i]+1 * emargin[e_j] = emargin[e_j]+1 * if dict[f_i] == NULL: # <<<<<<<<<<<<<< * dict[f_i] = new_node(e_j) * dict[f_i].val = 1 */ - __pyx_t_10 = (((__pyx_v_dict[__pyx_v_f_i]) == NULL) != 0); - if (__pyx_t_10) { + __pyx_t_11 = (((__pyx_v_dict[__pyx_v_f_i]) == NULL) != 0); + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":129 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":129 * emargin[e_j] = emargin[e_j]+1 * if dict[f_i] == NULL: * dict[f_i] = new_node(e_j) # <<<<<<<<<<<<<< @@ -14545,7 +15371,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_4cdec_2sa_3_sa_new_node(__pyx_v_e_j); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":130 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":130 * if dict[f_i] == NULL: * dict[f_i] = new_node(e_j) * dict[f_i].val = 1 # <<<<<<<<<<<<<< @@ -14554,7 +15380,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_dict[__pyx_v_f_i])->val = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":131 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":131 * dict[f_i] = new_node(e_j) * dict[f_i].val = 1 * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14566,7 +15392,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":133 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":133 * num_pairs = num_pairs + 1 * else: * count = get_val(dict[f_i], e_j) # <<<<<<<<<<<<<< @@ -14575,17 +15401,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_count = __pyx_f_4cdec_2sa_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_e_j); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":134 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":134 * else: * count = get_val(dict[f_i], e_j) * if count[0] == 0: # <<<<<<<<<<<<<< * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 */ - __pyx_t_10 = (((__pyx_v_count[0]) == 0) != 0); - if (__pyx_t_10) { + __pyx_t_11 = (((__pyx_v_count[0]) == 0) != 0); + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":135 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":135 * count = get_val(dict[f_i], e_j) * if count[0] == 0: * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14597,7 +15423,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob } __pyx_L17:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":136 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":136 * if count[0] == 0: * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 # <<<<<<<<<<<<<< @@ -14608,7 +15434,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob } __pyx_L16:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":138 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":138 * count[0] = count[0] + 1 * # add count * faligned[i] = 1 # <<<<<<<<<<<<<< @@ -14617,7 +15443,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_faligned[__pyx_v_i]) = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":139 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":139 * # add count * faligned[i] = 1 * ealigned[j] = 1 # <<<<<<<<<<<<<< @@ -14627,27 +15453,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob (__pyx_v_ealigned[__pyx_v_j]) = 1; } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":140 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":140 * faligned[i] = 1 * ealigned[j] = 1 * for i from 0 <= i < I: # <<<<<<<<<<<<<< * if faligned[i] == 0: * f_i = fsent[i] */ - __pyx_t_7 = __pyx_v_I; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + __pyx_t_8 = __pyx_v_I; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":141 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":141 * ealigned[j] = 1 * for i from 0 <= i < I: * if faligned[i] == 0: # <<<<<<<<<<<<<< * f_i = fsent[i] * fmargin[f_i] = fmargin[f_i] + 1 */ - __pyx_t_10 = (((__pyx_v_faligned[__pyx_v_i]) == 0) != 0); - if (__pyx_t_10) { + __pyx_t_11 = (((__pyx_v_faligned[__pyx_v_i]) == 0) != 0); + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":142 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":142 * for i from 0 <= i < I: * if faligned[i] == 0: * f_i = fsent[i] # <<<<<<<<<<<<<< @@ -14656,7 +15482,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_f_i = (__pyx_v_fsent[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":143 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":143 * if faligned[i] == 0: * f_i = fsent[i] * fmargin[f_i] = fmargin[f_i] + 1 # <<<<<<<<<<<<<< @@ -14665,7 +15491,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_fmargin[__pyx_v_f_i]) = ((__pyx_v_fmargin[__pyx_v_f_i]) + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":144 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":144 * f_i = fsent[i] * fmargin[f_i] = fmargin[f_i] + 1 * emargin[null_word] = emargin[null_word] + 1 # <<<<<<<<<<<<<< @@ -14674,17 +15500,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_emargin[__pyx_v_null_word]) = ((__pyx_v_emargin[__pyx_v_null_word]) + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":145 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":145 * fmargin[f_i] = fmargin[f_i] + 1 * emargin[null_word] = emargin[null_word] + 1 * if dict[f_i] == NULL: # <<<<<<<<<<<<<< * dict[f_i] = new_node(null_word) * dict[f_i].val = 1 */ - __pyx_t_10 = (((__pyx_v_dict[__pyx_v_f_i]) == NULL) != 0); - if (__pyx_t_10) { + __pyx_t_11 = (((__pyx_v_dict[__pyx_v_f_i]) == NULL) != 0); + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":146 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":146 * emargin[null_word] = emargin[null_word] + 1 * if dict[f_i] == NULL: * dict[f_i] = new_node(null_word) # <<<<<<<<<<<<<< @@ -14693,7 +15519,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_4cdec_2sa_3_sa_new_node(__pyx_v_null_word); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":147 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":147 * if dict[f_i] == NULL: * dict[f_i] = new_node(null_word) * dict[f_i].val = 1 # <<<<<<<<<<<<<< @@ -14702,7 +15528,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_dict[__pyx_v_f_i])->val = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":148 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":148 * dict[f_i] = new_node(null_word) * dict[f_i].val = 1 * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14714,7 +15540,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":150 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":150 * num_pairs = num_pairs + 1 * else: * count = get_val(dict[f_i], null_word) # <<<<<<<<<<<<<< @@ -14723,17 +15549,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_count = __pyx_f_4cdec_2sa_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_null_word); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":151 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":151 * else: * count = get_val(dict[f_i], null_word) * if count[0] == 0: # <<<<<<<<<<<<<< * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 */ - __pyx_t_10 = (((__pyx_v_count[0]) == 0) != 0); - if (__pyx_t_10) { + __pyx_t_11 = (((__pyx_v_count[0]) == 0) != 0); + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":152 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":152 * count = get_val(dict[f_i], null_word) * if count[0] == 0: * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14745,7 +15571,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob } __pyx_L22:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":153 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":153 * if count[0] == 0: * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 # <<<<<<<<<<<<<< @@ -14760,27 +15586,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob __pyx_L20:; } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":154 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":154 * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 * for j from 0 <= j < J: # <<<<<<<<<<<<<< * if ealigned[j] == 0: * e_j = esent[j] */ - __pyx_t_7 = __pyx_v_J; - for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + __pyx_t_8 = __pyx_v_J; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":155 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":155 * count[0] = count[0] + 1 * for j from 0 <= j < J: * if ealigned[j] == 0: # <<<<<<<<<<<<<< * e_j = esent[j] * fmargin[null_word] = fmargin[null_word] + 1 */ - __pyx_t_10 = (((__pyx_v_ealigned[__pyx_v_j]) == 0) != 0); - if (__pyx_t_10) { + __pyx_t_11 = (((__pyx_v_ealigned[__pyx_v_j]) == 0) != 0); + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":156 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":156 * for j from 0 <= j < J: * if ealigned[j] == 0: * e_j = esent[j] # <<<<<<<<<<<<<< @@ -14789,7 +15615,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_e_j = (__pyx_v_esent[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":157 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":157 * if ealigned[j] == 0: * e_j = esent[j] * fmargin[null_word] = fmargin[null_word] + 1 # <<<<<<<<<<<<<< @@ -14798,7 +15624,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_fmargin[__pyx_v_null_word]) = ((__pyx_v_fmargin[__pyx_v_null_word]) + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":158 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":158 * e_j = esent[j] * fmargin[null_word] = fmargin[null_word] + 1 * emargin[e_j] = emargin[e_j] + 1 # <<<<<<<<<<<<<< @@ -14807,17 +15633,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_emargin[__pyx_v_e_j]) = ((__pyx_v_emargin[__pyx_v_e_j]) + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":159 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":159 * fmargin[null_word] = fmargin[null_word] + 1 * emargin[e_j] = emargin[e_j] + 1 * if dict[null_word] == NULL: # <<<<<<<<<<<<<< * dict[null_word] = new_node(e_j) * dict[null_word].val = 1 */ - __pyx_t_10 = (((__pyx_v_dict[__pyx_v_null_word]) == NULL) != 0); - if (__pyx_t_10) { + __pyx_t_11 = (((__pyx_v_dict[__pyx_v_null_word]) == NULL) != 0); + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":160 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":160 * emargin[e_j] = emargin[e_j] + 1 * if dict[null_word] == NULL: * dict[null_word] = new_node(e_j) # <<<<<<<<<<<<<< @@ -14826,7 +15652,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_dict[__pyx_v_null_word]) = __pyx_f_4cdec_2sa_3_sa_new_node(__pyx_v_e_j); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":161 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":161 * if dict[null_word] == NULL: * dict[null_word] = new_node(e_j) * dict[null_word].val = 1 # <<<<<<<<<<<<<< @@ -14835,7 +15661,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ (__pyx_v_dict[__pyx_v_null_word])->val = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":162 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":162 * dict[null_word] = new_node(e_j) * dict[null_word].val = 1 * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14847,7 +15673,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":164 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":164 * num_pairs = num_pairs + 1 * else: * count = get_val(dict[null_word], e_j) # <<<<<<<<<<<<<< @@ -14856,17 +15682,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_count = __pyx_f_4cdec_2sa_3_sa_get_val((__pyx_v_dict[__pyx_v_null_word]), __pyx_v_e_j); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":165 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":165 * else: * count = get_val(dict[null_word], e_j) * if count[0] == 0: # <<<<<<<<<<<<<< * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 */ - __pyx_t_10 = (((__pyx_v_count[0]) == 0) != 0); - if (__pyx_t_10) { + __pyx_t_11 = (((__pyx_v_count[0]) == 0) != 0); + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":166 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":166 * count = get_val(dict[null_word], e_j) * if count[0] == 0: * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14878,7 +15704,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob } __pyx_L27:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":167 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":167 * if count[0] == 0: * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 # <<<<<<<<<<<<<< @@ -14893,7 +15719,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob __pyx_L25:; } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":168 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":168 * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 * free(links) # <<<<<<<<<<<<<< @@ -14902,7 +15728,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ free(__pyx_v_links); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":169 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":169 * count[0] = count[0] + 1 * free(links) * free(faligned) # <<<<<<<<<<<<<< @@ -14911,7 +15737,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ free(__pyx_v_faligned); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":170 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":170 * free(links) * free(faligned) * free(ealigned) # <<<<<<<<<<<<<< @@ -14921,95 +15747,95 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob free(__pyx_v_ealigned); } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":171 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":171 * free(faligned) * free(ealigned) * self.f_index = IntList(initial_len=V_F) # <<<<<<<<<<<<<< * self.e_index = IntList(initial_len=num_pairs) * self.col1 = FloatList(initial_len=num_pairs) */ - __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __pyx_t_13 = PyInt_FromLong(__pyx_v_V_F); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_V_F); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_initial_len, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 171; __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_GIVEREF(__pyx_t_14); __Pyx_GOTREF(__pyx_v_self->f_index); __Pyx_DECREF(((PyObject *)__pyx_v_self->f_index)); - __pyx_v_self->f_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_13); - __pyx_t_13 = 0; + __pyx_v_self->f_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_14); + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":172 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":172 * free(ealigned) * self.f_index = IntList(initial_len=V_F) * self.e_index = IntList(initial_len=num_pairs) # <<<<<<<<<<<<<< * self.col1 = FloatList(initial_len=num_pairs) * self.col2 = FloatList(initial_len=num_pairs) */ - __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_13)); - __pyx_t_12 = PyInt_FromLong(__pyx_v_num_pairs); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __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 = 172; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __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_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_num_pairs); 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); + if (PyDict_SetItem(__pyx_t_14, __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_14); 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(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GIVEREF(__pyx_t_13); __Pyx_GOTREF(__pyx_v_self->e_index); __Pyx_DECREF(((PyObject *)__pyx_v_self->e_index)); - __pyx_v_self->e_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_12); - __pyx_t_12 = 0; + __pyx_v_self->e_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_13); + __pyx_t_13 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":173 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":173 * self.f_index = IntList(initial_len=V_F) * self.e_index = IntList(initial_len=num_pairs) * self.col1 = FloatList(initial_len=num_pairs) # <<<<<<<<<<<<<< * self.col2 = FloatList(initial_len=num_pairs) * */ - __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __pyx_t_13 = PyInt_FromLong(__pyx_v_num_pairs); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_num_pairs); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_initial_len, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), __pyx_empty_tuple, __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __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_GIVEREF(__pyx_t_14); __Pyx_GOTREF(__pyx_v_self->col1); __Pyx_DECREF(((PyObject *)__pyx_v_self->col1)); - __pyx_v_self->col1 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_13); - __pyx_t_13 = 0; + __pyx_v_self->col1 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_14); + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":174 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":174 * self.e_index = IntList(initial_len=num_pairs) * self.col1 = FloatList(initial_len=num_pairs) * self.col2 = FloatList(initial_len=num_pairs) # <<<<<<<<<<<<<< * * num_pairs = 0 */ - __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_13)); - __pyx_t_12 = PyInt_FromLong(__pyx_v_num_pairs); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __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 = 174; __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_4cdec_2sa_3_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; __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_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_num_pairs); 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); + if (PyDict_SetItem(__pyx_t_14, __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), __pyx_empty_tuple, __pyx_t_14); 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(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GIVEREF(__pyx_t_13); __Pyx_GOTREF(__pyx_v_self->col2); __Pyx_DECREF(((PyObject *)__pyx_v_self->col2)); - __pyx_v_self->col2 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_12); - __pyx_t_12 = 0; + __pyx_v_self->col2 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_13); + __pyx_t_13 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":176 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":176 * self.col2 = FloatList(initial_len=num_pairs) * * num_pairs = 0 # <<<<<<<<<<<<<< @@ -15018,17 +15844,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ __pyx_v_num_pairs = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":177 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":177 * * num_pairs = 0 * for i from 0 <= i < V_F: # <<<<<<<<<<<<<< * #self.f_index[i] = num_pairs * self.f_index.set(i, num_pairs) */ - __pyx_t_6 = __pyx_v_V_F; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { + __pyx_t_7 = __pyx_v_V_F; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":179 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":179 * for i from 0 <= i < V_F: * #self.f_index[i] = num_pairs * self.f_index.set(i, num_pairs) # <<<<<<<<<<<<<< @@ -15037,43 +15863,43 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->set(__pyx_v_self->f_index, __pyx_v_i, __pyx_v_num_pairs); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":180 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":180 * #self.f_index[i] = num_pairs * self.f_index.set(i, num_pairs) * if dict[i] != NULL: # <<<<<<<<<<<<<< * self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) * del_node(dict[i]) */ - __pyx_t_10 = (((__pyx_v_dict[__pyx_v_i]) != NULL) != 0); - if (__pyx_t_10) { + __pyx_t_11 = (((__pyx_v_dict[__pyx_v_i]) != NULL) != 0); + if (__pyx_t_11) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":181 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":181 * self.f_index.set(i, num_pairs) * if dict[i] != NULL: * self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) # <<<<<<<<<<<<<< * del_node(dict[i]) * free(fmargin) */ - __pyx_t_12 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = ((struct __pyx_vtabstruct_4cdec_2sa_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_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":182 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":182 * if dict[i] != NULL: * self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) * del_node(dict[i]) # <<<<<<<<<<<<<< * free(fmargin) * free(emargin) */ - __pyx_t_12 = __pyx_f_4cdec_2sa_3_sa_del_node((__pyx_v_dict[__pyx_v_i])); 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; + __pyx_t_13 = __pyx_f_4cdec_2sa_3_sa_del_node((__pyx_v_dict[__pyx_v_i])); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L30; } __pyx_L30:; } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":183 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":183 * self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) * del_node(dict[i]) * free(fmargin) # <<<<<<<<<<<<<< @@ -15082,7 +15908,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ free(__pyx_v_fmargin); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":184 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":184 * del_node(dict[i]) * free(fmargin) * free(emargin) # <<<<<<<<<<<<<< @@ -15091,7 +15917,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ free(__pyx_v_emargin); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":185 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":185 * free(fmargin) * free(emargin) * free(dict) # <<<<<<<<<<<<<< @@ -15100,7 +15926,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob */ free(__pyx_v_dict); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":186 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":186 * free(emargin) * free(dict) * return # <<<<<<<<<<<<<< @@ -15111,15 +15937,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":72 + * + * + * cdef compute_from_data(self, SuffixArray fsa, DataArray eda, Alignment aa): # <<<<<<<<<<<<<< + * cdef int sent_id, num_links, l, i, j, f_i, e_j, I, J, V_E, V_F, num_pairs + * cdef int *fsent, *esent, *alignment, *links, *ealigned, *faligned + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("cdec.sa._sa.BiLex.compute_from_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -15131,7 +15964,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":189 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":189 * * * cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin): # <<<<<<<<<<<<<< @@ -15150,7 +15983,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_add_node", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":191 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":191 * cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin): * cdef int loc * if n.smaller != NULL: # <<<<<<<<<<<<<< @@ -15160,7 +15993,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ __pyx_t_1 = ((__pyx_v_n->smaller != NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":192 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":192 * cdef int loc * if n.smaller != NULL: * self._add_node(n.smaller, num_pairs, fmargin, emargin) # <<<<<<<<<<<<<< @@ -15174,7 +16007,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":193 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":193 * if n.smaller != NULL: * self._add_node(n.smaller, num_pairs, fmargin, emargin) * loc = num_pairs[0] # <<<<<<<<<<<<<< @@ -15183,7 +16016,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ */ __pyx_v_loc = (__pyx_v_num_pairs[0]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":194 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":194 * self._add_node(n.smaller, num_pairs, fmargin, emargin) * loc = num_pairs[0] * self.e_index.set(loc, n.key) # <<<<<<<<<<<<<< @@ -15192,7 +16025,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->set(__pyx_v_self->e_index, __pyx_v_loc, __pyx_v_n->key); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":195 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":195 * loc = num_pairs[0] * self.e_index.set(loc, n.key) * self.col1.set(loc, float(n.val)/fmargin) # <<<<<<<<<<<<<< @@ -15203,7 +16036,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif @@ -15211,7 +16044,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ } ((struct __pyx_vtabstruct_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":196 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":196 * self.e_index.set(loc, n.key) * self.col1.set(loc, float(n.val)/fmargin) * self.col2.set(loc, float(n.val)/float(emargin[n.key])) # <<<<<<<<<<<<<< @@ -15222,7 +16055,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif @@ -15230,7 +16063,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ } ((struct __pyx_vtabstruct_4cdec_2sa_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])))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":197 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":197 * self.col1.set(loc, float(n.val)/fmargin) * self.col2.set(loc, float(n.val)/float(emargin[n.key])) * num_pairs[0] = loc + 1 # <<<<<<<<<<<<<< @@ -15239,7 +16072,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ */ (__pyx_v_num_pairs[0]) = (__pyx_v_loc + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":198 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":198 * self.col2.set(loc, float(n.val)/float(emargin[n.key])) * num_pairs[0] = loc + 1 * if n.bigger != NULL: # <<<<<<<<<<<<<< @@ -15249,7 +16082,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ __pyx_t_1 = ((__pyx_v_n->bigger != NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":199 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":199 * num_pairs[0] = loc + 1 * if n.bigger != NULL: * self._add_node(n.bigger, num_pairs, fmargin, emargin) # <<<<<<<<<<<<<< @@ -15263,6 +16096,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ } __pyx_L4:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":189 + * + * + * cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin): # <<<<<<<<<<<<<< + * cdef int loc + * if n.smaller != NULL: + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -15275,6 +16117,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":202 + * + * + * def write_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -15295,18 +16145,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_3write_binary(PyObject *__pyx_v_ return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":202 - * - * - * def write_binary(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "w") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; @@ -15318,16 +16162,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":204 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":204 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< * self.f_index.write_handle(f) * self.e_index.write_handle(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":205 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":205 * cdef FILE* f * f = fopen(filename, "w") * self.f_index.write_handle(f) # <<<<<<<<<<<<<< @@ -15336,7 +16180,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4 */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->write_handle(__pyx_v_self->f_index, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":206 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":206 * f = fopen(filename, "w") * self.f_index.write_handle(f) * self.e_index.write_handle(f) # <<<<<<<<<<<<<< @@ -15345,7 +16189,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4 */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->write_handle(__pyx_v_self->e_index, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":207 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":207 * self.f_index.write_handle(f) * self.e_index.write_handle(f) * self.col1.write_handle(f) # <<<<<<<<<<<<<< @@ -15354,7 +16198,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4 */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->write_handle(__pyx_v_self->col1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":208 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":208 * self.e_index.write_handle(f) * self.col1.write_handle(f) * self.col2.write_handle(f) # <<<<<<<<<<<<<< @@ -15363,7 +16207,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4 */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->write_handle(__pyx_v_self->col2, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":209 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":209 * self.col1.write_handle(f) * self.col2.write_handle(f) * self.write_wordlist(self.id2fword, f) # <<<<<<<<<<<<<< @@ -15377,7 +16221,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":210 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":210 * self.col2.write_handle(f) * self.write_wordlist(self.id2fword, f) * self.write_wordlist(self.id2eword, f) # <<<<<<<<<<<<<< @@ -15391,7 +16235,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":211 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":211 * self.write_wordlist(self.id2fword, f) * self.write_wordlist(self.id2eword, f) * fclose(f) # <<<<<<<<<<<<<< @@ -15400,6 +16244,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4 */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":202 + * + * + * def write_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -15413,7 +16266,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4 return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":214 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":214 * * * cdef write_wordlist(self, wordlist, FILE* f): # <<<<<<<<<<<<<< @@ -15438,7 +16291,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_wordlist", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":218 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":218 * cdef int num_words * * num_words = len(wordlist) # <<<<<<<<<<<<<< @@ -15448,7 +16301,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru __pyx_t_1 = PyObject_Length(__pyx_v_wordlist); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_words = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":219 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":219 * * num_words = len(wordlist) * fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -15457,7 +16310,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru */ fwrite((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":220 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":220 * num_words = len(wordlist) * fwrite(&(num_words), sizeof(int), 1, f) * for word in wordlist: # <<<<<<<<<<<<<< @@ -15490,8 +16343,9 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru } else { __pyx_t_4 = __pyx_t_3(__pyx_t_2); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -15501,7 +16355,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":221 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":221 * fwrite(&(num_words), sizeof(int), 1, f) * for word in wordlist: * word_len = len(word) + 1 # <<<<<<<<<<<<<< @@ -15511,7 +16365,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru __pyx_t_5 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_word_len = (__pyx_t_5 + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":222 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":222 * for word in wordlist: * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -15520,7 +16374,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru */ fwrite((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":223 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":223 * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) * fwrite(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<< @@ -15532,6 +16386,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":214 + * + * + * cdef write_wordlist(self, wordlist, FILE* f): # <<<<<<<<<<<<<< + * cdef int word_len + * cdef int num_words + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -15546,7 +16409,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":226 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":226 * * * cdef read_wordlist(self, word2id, id2word, FILE* f): # <<<<<<<<<<<<<< @@ -15565,12 +16428,13 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_wordlist", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":231 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":231 * cdef char* word * * fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -15579,7 +16443,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc */ fread((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":232 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":232 * * fread(&(num_words), sizeof(int), 1, f) * for i from 0 <= i < num_words: # <<<<<<<<<<<<<< @@ -15589,7 +16453,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc __pyx_t_1 = __pyx_v_num_words; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":233 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":233 * fread(&(num_words), sizeof(int), 1, f) * for i from 0 <= i < num_words: * fread(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -15598,7 +16462,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc */ fread((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":234 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":234 * for i from 0 <= i < num_words: * fread(&(word_len), sizeof(int), 1, f) * word = malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<< @@ -15607,7 +16471,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc */ __pyx_v_word = ((char *)malloc((__pyx_v_word_len * (sizeof(char))))); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":235 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":235 * fread(&(word_len), sizeof(int), 1, f) * word = malloc (word_len * sizeof(char)) * fread(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<< @@ -15616,7 +16480,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc */ fread(__pyx_v_word, (sizeof(char)), __pyx_v_word_len, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":236 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":236 * word = malloc (word_len * sizeof(char)) * fread(word, sizeof(char), word_len, f) * word2id[word] = len(id2word) # <<<<<<<<<<<<<< @@ -15627,12 +16491,12 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - if (PyObject_SetItem(__pyx_v_word2id, ((PyObject *)__pyx_t_4), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyObject_SetItem(__pyx_v_word2id, __pyx_t_4, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 236; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":237 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":237 * fread(word, sizeof(char), word_len, f) * word2id[word] = len(id2word) * id2word.append(word) # <<<<<<<<<<<<<< @@ -15640,13 +16504,11 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc * */ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_id2word, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_id2word, __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":238 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":238 * word2id[word] = len(id2word) * id2word.append(word) * free(word) # <<<<<<<<<<<<<< @@ -15656,6 +16518,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc free(__pyx_v_word); } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":226 + * + * + * cdef read_wordlist(self, word2id, id2word, FILE* f): # <<<<<<<<<<<<<< + * cdef int num_words + * cdef int word_len + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -15669,6 +16540,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":240 + * free(word) + * + * def read_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -15689,18 +16568,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_5read_binary(PyObject *__pyx_v_s return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":240 - * free(word) - * - * def read_binary(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "r") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; @@ -15713,16 +16586,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":242 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":242 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< * self.f_index.read_handle(f) * self.e_index.read_handle(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":243 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":243 * cdef FILE* f * f = fopen(filename, "r") * self.f_index.read_handle(f) # <<<<<<<<<<<<<< @@ -15731,7 +16604,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->read_handle(__pyx_v_self->f_index, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":244 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":244 * f = fopen(filename, "r") * self.f_index.read_handle(f) * self.e_index.read_handle(f) # <<<<<<<<<<<<<< @@ -15740,7 +16613,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->read_handle(__pyx_v_self->e_index, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":245 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":245 * self.f_index.read_handle(f) * self.e_index.read_handle(f) * self.col1.read_handle(f) # <<<<<<<<<<<<<< @@ -15749,7 +16622,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->read_handle(__pyx_v_self->col1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":246 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":246 * self.e_index.read_handle(f) * self.col1.read_handle(f) * self.col2.read_handle(f) # <<<<<<<<<<<<<< @@ -15758,7 +16631,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->read_handle(__pyx_v_self->col2, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":247 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":247 * self.col1.read_handle(f) * self.col2.read_handle(f) * self.read_wordlist(self.fword2id, self.id2fword, f) # <<<<<<<<<<<<<< @@ -15775,7 +16648,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":248 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":248 * self.col2.read_handle(f) * self.read_wordlist(self.fword2id, self.id2fword, f) * self.read_wordlist(self.eword2id, self.id2eword, f) # <<<<<<<<<<<<<< @@ -15792,7 +16665,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":249 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":249 * self.read_wordlist(self.fword2id, self.id2fword, f) * self.read_wordlist(self.eword2id, self.id2eword, f) * fclose(f) # <<<<<<<<<<<<<< @@ -15801,6 +16674,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":240 + * free(word) + * + * def read_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -15815,6 +16697,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":252 + * + * + * def contains_e_word(self, eword): # <<<<<<<<<<<<<< + * return (eword in self.eword2id) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_7contains_e_word(PyObject *__pyx_v_self, PyObject *__pyx_v_eword); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_7contains_e_word(PyObject *__pyx_v_self, PyObject *__pyx_v_eword) { @@ -15822,18 +16712,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_7contains_e_word(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains_e_word (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex_6contains_e_word(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), ((PyObject *)__pyx_v_eword)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":252 - * - * - * def contains_e_word(self, eword): # <<<<<<<<<<<<<< - * return (eword in self.eword2id) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_6contains_e_word(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_eword) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -15844,7 +16728,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_6contains_e_word(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains_e_word", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":253 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":253 * * def contains_e_word(self, eword): * return (eword in self.eword2id) # <<<<<<<<<<<<<< @@ -15859,8 +16743,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_6contains_e_word(struct __pyx_ob __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":252 + * + * + * def contains_e_word(self, eword): # <<<<<<<<<<<<<< + * return (eword in self.eword2id) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.BiLex.contains_e_word", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -15871,6 +16762,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_6contains_e_word(struct __pyx_ob return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":256 + * + * + * def contains_f_word(self, fword): # <<<<<<<<<<<<<< + * return (fword in self.fword2id) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_9contains_f_word(PyObject *__pyx_v_self, PyObject *__pyx_v_fword); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_9contains_f_word(PyObject *__pyx_v_self, PyObject *__pyx_v_fword) { @@ -15878,18 +16777,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_9contains_f_word(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains_f_word (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex_8contains_f_word(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), ((PyObject *)__pyx_v_fword)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":256 - * - * - * def contains_f_word(self, fword): # <<<<<<<<<<<<<< - * return (fword in self.fword2id) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_8contains_f_word(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_fword) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -15900,7 +16793,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_8contains_f_word(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains_f_word", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":257 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":257 * * def contains_f_word(self, fword): * return (fword in self.fword2id) # <<<<<<<<<<<<<< @@ -15915,8 +16808,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_8contains_f_word(struct __pyx_ob __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":256 + * + * + * def contains_f_word(self, fword): # <<<<<<<<<<<<<< + * return (fword in self.fword2id) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.BiLex.contains_f_word", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -15927,6 +16827,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_8contains_f_word(struct __pyx_ob return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":260 + * + * + * def get_e_id(self, eword): # <<<<<<<<<<<<<< + * if eword not in self.eword2id: + * e_id = len(self.id2eword) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_11get_e_id(PyObject *__pyx_v_self, PyObject *__pyx_v_eword); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_11get_e_id(PyObject *__pyx_v_self, PyObject *__pyx_v_eword) { @@ -15934,32 +16842,27 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_11get_e_id(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_e_id (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), ((PyObject *)__pyx_v_eword)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":260 - * - * - * def get_e_id(self, eword): # <<<<<<<<<<<<<< - * if eword not in self.eword2id: - * e_id = len(self.id2eword) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_eword) { - PyObject *__pyx_v_e_id = NULL; + Py_ssize_t __pyx_v_e_id; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; + int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_e_id", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":261 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":261 * * def get_e_id(self, eword): * if eword not in self.eword2id: # <<<<<<<<<<<<<< @@ -15970,7 +16873,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cde __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":262 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":262 * def get_e_id(self, eword): * if eword not in self.eword2id: * e_id = len(self.id2eword) # <<<<<<<<<<<<<< @@ -15981,35 +16884,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cde __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_e_id = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_e_id = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":263 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":263 * if eword not in self.eword2id: * e_id = len(self.id2eword) * self.id2eword.append(eword) # <<<<<<<<<<<<<< * self.eword2id[eword] = e_id * return self.eword2id[eword] */ - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_self->id2eword, __pyx_v_eword); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2eword, __pyx_v_eword); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":264 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":264 * e_id = len(self.id2eword) * self.id2eword.append(eword) * self.eword2id[eword] = e_id # <<<<<<<<<<<<<< * return self.eword2id[eword] * */ - if (PyObject_SetItem(__pyx_v_self->eword2id, __pyx_v_eword, __pyx_v_e_id) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_e_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyObject_SetItem(__pyx_v_self->eword2id, __pyx_v_eword, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L3; } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":265 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":265 * self.id2eword.append(eword) * self.eword2id[eword] = e_id * return self.eword2id[eword] # <<<<<<<<<<<<<< @@ -16017,25 +16918,39 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cde * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyObject_GetItem(__pyx_v_self->eword2id, __pyx_v_eword); if (!__pyx_t_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->eword2id, __pyx_v_eword); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":260 + * + * + * def get_e_id(self, eword): # <<<<<<<<<<<<<< + * if eword not in self.eword2id: + * e_id = len(self.id2eword) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cdec.sa._sa.BiLex.get_e_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_e_id); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":268 + * + * + * def get_f_id(self, fword): # <<<<<<<<<<<<<< + * if fword not in self.fword2id: + * f_id = len(self.id2fword) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_13get_f_id(PyObject *__pyx_v_self, PyObject *__pyx_v_fword); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_13get_f_id(PyObject *__pyx_v_self, PyObject *__pyx_v_fword) { @@ -16043,32 +16958,27 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_13get_f_id(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_f_id (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), ((PyObject *)__pyx_v_fword)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":268 - * - * - * def get_f_id(self, fword): # <<<<<<<<<<<<<< - * if fword not in self.fword2id: - * f_id = len(self.id2fword) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_fword) { - PyObject *__pyx_v_f_id = NULL; + Py_ssize_t __pyx_v_f_id; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; + int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_f_id", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":269 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":269 * * def get_f_id(self, fword): * if fword not in self.fword2id: # <<<<<<<<<<<<<< @@ -16079,7 +16989,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cde __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":270 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":270 * def get_f_id(self, fword): * if fword not in self.fword2id: * f_id = len(self.id2fword) # <<<<<<<<<<<<<< @@ -16090,35 +17000,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cde __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_f_id = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_f_id = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":271 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":271 * if fword not in self.fword2id: * f_id = len(self.id2fword) * self.id2fword.append(fword) # <<<<<<<<<<<<<< * self.fword2id[fword] = f_id * return self.fword2id[fword] */ - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_self->id2fword, __pyx_v_fword); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2fword, __pyx_v_fword); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":272 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":272 * f_id = len(self.id2fword) * self.id2fword.append(fword) * self.fword2id[fword] = f_id # <<<<<<<<<<<<<< * return self.fword2id[fword] * */ - if (PyObject_SetItem(__pyx_v_self->fword2id, __pyx_v_fword, __pyx_v_f_id) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_f_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyObject_SetItem(__pyx_v_self->fword2id, __pyx_v_fword, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L3; } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":273 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":273 * self.id2fword.append(fword) * self.fword2id[fword] = f_id * return self.fword2id[fword] # <<<<<<<<<<<<<< @@ -16126,25 +17034,39 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cde * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyObject_GetItem(__pyx_v_self->fword2id, __pyx_v_fword); if (!__pyx_t_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->fword2id, __pyx_v_fword); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":268 + * + * + * def get_f_id(self, fword): # <<<<<<<<<<<<<< + * if fword not in self.fword2id: + * f_id = len(self.id2fword) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cdec.sa._sa.BiLex.get_f_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_f_id); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":276 + * + * + * def read_text(self, char* filename): # <<<<<<<<<<<<<< + * cdef i, j, w, e_id, f_id, n_f, n_e, N + * cdef IntList fcount + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_15read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_15read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -16165,18 +17087,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_15read_text(PyObject *__pyx_v_se return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":276 - * - * - * def read_text(self, char* filename): # <<<<<<<<<<<<<< - * cdef i, j, w, e_id, f_id, n_f, n_e, N - * cdef IntList fcount - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_i = 0; PyObject *__pyx_v_j = 0; @@ -16211,32 +17127,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd PyObject *(*__pyx_t_14)(PyObject *); Py_ssize_t __pyx_t_15; int __pyx_t_16; - Py_ssize_t __pyx_t_17; - long __pyx_t_18; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; long __pyx_t_19; - int __pyx_t_20; - double __pyx_t_21; - PyObject *__pyx_t_22 = NULL; - int __pyx_t_23; + long __pyx_t_20; + int __pyx_t_21; + double __pyx_t_22; + PyObject *__pyx_t_23 = NULL; int __pyx_t_24; + int __pyx_t_25; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":280 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":280 * cdef IntList fcount * * fcount = IntList() # <<<<<<<<<<<<<< * with gzip_or_text(filename) as f: * # first loop merely establishes size of array objects */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_fcount = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":281 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":281 * * fcount = IntList() * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -16244,24 +17161,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd * for line in f: */ /*with:*/ { - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __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)); + 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[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __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; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_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[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -16276,7 +17193,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __pyx_v_f = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":283 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":283 * with gzip_or_text(filename) as f: * # first loop merely establishes size of array objects * for line in f: # <<<<<<<<<<<<<< @@ -16309,8 +17226,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -16320,16 +17238,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":284 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":284 * # first loop merely establishes size of array objects * for line in f: * (fword, eword, score1, score2) = line.split() # <<<<<<<<<<<<<< * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L7_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[5]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { @@ -16361,17 +17279,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __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 = 284; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(item); - *(temps[i]) = item; + { + 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 = 284; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(item); + *(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 = 284; __pyx_clineno = __LINE__; goto __pyx_L7_error;} @@ -16403,49 +17322,49 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __Pyx_XDECREF_SET(__pyx_v_score2, __pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":285 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":285 * for line in f: * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) # <<<<<<<<<<<<<< * e_id = self.get_e_id(eword) * while f_id >= len(fcount): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__get_f_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_f_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_fword); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_fword); __Pyx_GIVEREF(__pyx_v_fword); - __pyx_t_11 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_f_id, __pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":286 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":286 * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) # <<<<<<<<<<<<<< * while f_id >= len(fcount): * fcount.append(0) */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__get_e_id); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_e_id); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_eword); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_eword); __Pyx_GIVEREF(__pyx_v_eword); - __pyx_t_3 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_e_id, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":287 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":287 * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) * while f_id >= len(fcount): # <<<<<<<<<<<<<< @@ -16462,19 +17381,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (!__pyx_t_16) break; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":288 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":288 * e_id = self.get_e_id(eword) * while f_id >= len(fcount): * fcount.append(0) # <<<<<<<<<<<<<< * fcount.arr[f_id] = fcount.arr[f_id] + 1 * */ - __pyx_t_12 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_fcount), __pyx_int_0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_17 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_fcount), __pyx_int_0); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":289 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":289 * while f_id >= len(fcount): * fcount.append(0) * fcount.arr[f_id] = fcount.arr[f_id] + 1 # <<<<<<<<<<<<<< @@ -16482,12 +17399,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd * # Allocate space for dictionary in arrays */ __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - (__pyx_v_fcount->arr[__pyx_t_17]) = ((__pyx_v_fcount->arr[__pyx_t_15]) + 1); + __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + (__pyx_v_fcount->arr[__pyx_t_18]) = ((__pyx_v_fcount->arr[__pyx_t_15]) + 1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":292 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":292 * * # Allocate space for dictionary in arrays * N = 0 # <<<<<<<<<<<<<< @@ -16497,7 +17414,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __Pyx_INCREF(__pyx_int_0); __pyx_v_N = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":293 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":293 * # Allocate space for dictionary in arrays * N = 0 * n_f = len(fcount) # <<<<<<<<<<<<<< @@ -16510,7 +17427,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __pyx_v_n_f = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":294 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":294 * N = 0 * n_f = len(fcount) * self.f_index = IntList(initial_len=n_f+1) # <<<<<<<<<<<<<< @@ -16518,46 +17435,46 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd * self.f_index.arr[i] = N */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = PyNumber_Add(__pyx_v_n_f, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __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 = 294; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_initial_len, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__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_4cdec_2sa_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":295 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":295 * n_f = len(fcount) * self.f_index = IntList(initial_len=n_f+1) * for i from 0 <= i < n_f: # <<<<<<<<<<<<<< * self.f_index.arr[i] = N * N = N + fcount.arr[i] */ - __pyx_t_18 = __Pyx_PyInt_AsLong(__pyx_v_n_f); if (unlikely((__pyx_t_18 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19++) { - __pyx_t_12 = PyInt_FromLong(__pyx_t_19); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_19 = __Pyx_PyInt_As_long(__pyx_v_n_f); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20++) { + __pyx_t_12 = __Pyx_PyInt_From_long(__pyx_t_20); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":296 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":296 * self.f_index = IntList(initial_len=n_f+1) * for i from 0 <= i < n_f: * self.f_index.arr[i] = N # <<<<<<<<<<<<<< * N = N + fcount.arr[i] * fcount.arr[i] = 0 */ - __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_v_N); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - (__pyx_v_self->f_index->arr[__pyx_t_8]) = __pyx_t_20; + (__pyx_v_self->f_index->arr[__pyx_t_8]) = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":297 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":297 * for i from 0 <= i < n_f: * self.f_index.arr[i] = N * N = N + fcount.arr[i] # <<<<<<<<<<<<<< @@ -16565,7 +17482,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd * self.f_index.arr[n_f] = N */ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_12 = PyInt_FromLong((__pyx_v_fcount->arr[__pyx_t_8])); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = __Pyx_PyInt_From_int((__pyx_v_fcount->arr[__pyx_t_8])); 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_t_1 = PyNumber_Add(__pyx_v_N, __pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); @@ -16573,7 +17490,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":298 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":298 * self.f_index.arr[i] = N * N = N + fcount.arr[i] * fcount.arr[i] = 0 # <<<<<<<<<<<<<< @@ -16582,33 +17499,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd */ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} (__pyx_v_fcount->arr[__pyx_t_8]) = 0; - __pyx_t_19 = __Pyx_PyInt_AsLong(__pyx_v_i); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_20 = __Pyx_PyInt_As_long(__pyx_v_i); if (unlikely((__pyx_t_20 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":295 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":295 * n_f = len(fcount) * self.f_index = IntList(initial_len=n_f+1) * for i from 0 <= i < n_f: # <<<<<<<<<<<<<< * self.f_index.arr[i] = N * N = N + fcount.arr[i] */ - __pyx_t_1 = PyInt_FromLong(__pyx_t_19); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_20); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":299 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":299 * N = N + fcount.arr[i] * fcount.arr[i] = 0 * self.f_index.arr[n_f] = N # <<<<<<<<<<<<<< * self.e_index = IntList(initial_len=N) * self.col1 = FloatList(initial_len=N) */ - __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_v_N); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n_f); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - (__pyx_v_self->f_index->arr[__pyx_t_8]) = __pyx_t_20; + (__pyx_v_self->f_index->arr[__pyx_t_8]) = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":300 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":300 * fcount.arr[i] = 0 * self.f_index.arr[n_f] = N * self.e_index = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -16616,18 +17533,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd * self.col2 = FloatList(initial_len=N) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 300; __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 = 300; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_initial_len, __pyx_v_N) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__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_4cdec_2sa_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":301 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":301 * self.f_index.arr[n_f] = N * self.e_index = IntList(initial_len=N) * self.col1 = FloatList(initial_len=N) # <<<<<<<<<<<<<< @@ -16635,18 +17552,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd * */ __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 301; __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 = 301; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_initial_len, __pyx_v_N) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), __pyx_empty_tuple, __pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(__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_4cdec_2sa_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":302 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":302 * self.e_index = IntList(initial_len=N) * self.col1 = FloatList(initial_len=N) * self.col2 = FloatList(initial_len=N) # <<<<<<<<<<<<<< @@ -16654,32 +17571,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd * # Re-read file, placing words into buckets */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 302; __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 = 302; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_initial_len, __pyx_v_N) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__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_4cdec_2sa_3_sa_FloatList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":305 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":305 * * # Re-read file, placing words into buckets * f.seek(0) # <<<<<<<<<<<<<< * for line in f: * (fword, eword, score1, score2) = line.split() */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__seek); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":306 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":306 * # Re-read file, placing words into buckets * f.seek(0) * for line in f: # <<<<<<<<<<<<<< @@ -16712,8 +17629,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd } else { __pyx_t_12 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_12)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -16723,16 +17641,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":307 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":307 * f.seek(0) * for line in f: * (fword, eword, score1, score2) = line.split() # <<<<<<<<<<<<<< * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s__split); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_split); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_3 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { @@ -16764,17 +17682,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __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 = 307; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(item); - *(temps[i]) = item; + { + 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 = 307; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(item); + *(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 = 307; __pyx_clineno = __LINE__; goto __pyx_L7_error;} @@ -16806,49 +17725,49 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __Pyx_XDECREF_SET(__pyx_v_score2, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":308 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":308 * for line in f: * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) # <<<<<<<<<<<<<< * e_id = self.get_e_id(eword) * index = self.f_index.arr[f_id] + fcount.arr[f_id] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__get_f_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_f_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_fword); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fword); __Pyx_GIVEREF(__pyx_v_fword); - __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_f_id, __pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":309 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":309 * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) # <<<<<<<<<<<<<< * index = self.f_index.arr[f_id] + fcount.arr[f_id] * fcount.arr[f_id] = fcount.arr[f_id] + 1 */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__get_e_id); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_e_id); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_eword); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_eword); __Pyx_GIVEREF(__pyx_v_eword); - __pyx_t_3 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_e_id, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":310 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":310 * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) * index = self.f_index.arr[f_id] + fcount.arr[f_id] # <<<<<<<<<<<<<< @@ -16856,68 +17775,62 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd * self.e_index.arr[index] = int(e_id) */ __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_3 = PyInt_FromLong(((__pyx_v_self->f_index->arr[__pyx_t_15]) + (__pyx_v_fcount->arr[__pyx_t_17]))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(((__pyx_v_self->f_index->arr[__pyx_t_15]) + (__pyx_v_fcount->arr[__pyx_t_18]))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":311 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":311 * e_id = self.get_e_id(eword) * index = self.f_index.arr[f_id] + fcount.arr[f_id] * fcount.arr[f_id] = fcount.arr[f_id] + 1 # <<<<<<<<<<<<<< * self.e_index.arr[index] = int(e_id) * self.col1[index] = float(score1) */ - __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - (__pyx_v_fcount->arr[__pyx_t_15]) = ((__pyx_v_fcount->arr[__pyx_t_17]) + 1); + (__pyx_v_fcount->arr[__pyx_t_15]) = ((__pyx_v_fcount->arr[__pyx_t_18]) + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":312 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":312 * index = self.f_index.arr[f_id] + fcount.arr[f_id] * fcount.arr[f_id] = fcount.arr[f_id] + 1 * self.e_index.arr[index] = int(e_id) # <<<<<<<<<<<<<< * self.col1[index] = float(score1) * self.col2[index] = float(score2) */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = PyNumber_Int(__pyx_v_e_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_e_id); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_e_id); - __Pyx_GIVEREF(__pyx_v_e_id); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - (__pyx_v_self->e_index->arr[__pyx_t_17]) = __pyx_t_20; + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + (__pyx_v_self->e_index->arr[__pyx_t_18]) = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":313 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":313 * fcount.arr[f_id] = fcount.arr[f_id] + 1 * self.e_index.arr[index] = int(e_id) * self.col1[index] = float(score1) # <<<<<<<<<<<<<< * self.col2[index] = float(score2) * */ - __pyx_t_21 = __Pyx_PyObject_AsDouble(__pyx_v_score1); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_2 = PyFloat_FromDouble(__pyx_t_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetItem(((PyObject *)__pyx_v_self->col1), __pyx_v_index, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_22 = __Pyx_PyObject_AsDouble(__pyx_v_score1); if (unlikely(__pyx_t_22 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_t_22); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->col1), __pyx_v_index, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":314 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":314 * self.e_index.arr[index] = int(e_id) * self.col1[index] = float(score1) * self.col2[index] = float(score2) # <<<<<<<<<<<<<< * * # Sort buckets by eword */ - __pyx_t_21 = __Pyx_PyObject_AsDouble(__pyx_v_score2); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_2 = PyFloat_FromDouble(__pyx_t_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetItem(((PyObject *)__pyx_v_self->col2), __pyx_v_index, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_22 = __Pyx_PyObject_AsDouble(__pyx_v_score2); if (unlikely(__pyx_t_22 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_t_22); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->col2), __pyx_v_index, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -16930,11 +17843,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":281 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":281 * * fcount = IntList() * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -16943,43 +17856,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd */ /*except:*/ { __Pyx_AddTraceback("cdec.sa._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 = 281; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_22 = PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); + __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_22); - __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_22); - __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_23); + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_23); + __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (__pyx_t_16 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __pyx_t_23 = ((!(__pyx_t_16 != 0)) != 0); - if (__pyx_t_23) { + __pyx_t_24 = ((!(__pyx_t_16 != 0)) != 0); + if (__pyx_t_24) { __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); - __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_3); - __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_2); + __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L30; } - __pyx_L30:; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; @@ -16997,15 +17899,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd } } /*finally:*/ { - if (__pyx_t_4) { - __pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_k_tuple_46, NULL); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_23 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_4) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__31, NULL); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L31; __pyx_L3_error:; @@ -17014,7 +17918,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd __pyx_L31:; } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":317 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":317 * * # Sort buckets by eword * for b from 0 <= b < n_f: # <<<<<<<<<<<<<< @@ -17022,14 +17926,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd * j = self.f_index.arr[b+1] */ if (unlikely(!__pyx_v_n_f)) { __Pyx_RaiseUnboundLocalError("n_f"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_19 = __Pyx_PyInt_AsLong(__pyx_v_n_f); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_19; __pyx_t_18++) { - __pyx_t_3 = PyInt_FromLong(__pyx_t_18); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_20 = __Pyx_PyInt_As_long(__pyx_v_n_f); if (unlikely((__pyx_t_20 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_20; __pyx_t_19++) { + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_19); 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_XDECREF_SET(__pyx_v_b, __pyx_t_2); + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":318 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":318 * # Sort buckets by eword * for b from 0 <= b < n_f: * i = self.f_index.arr[b] # <<<<<<<<<<<<<< @@ -17037,54 +17941,63 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd * self.qsort(i,j, "") */ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_b); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong((__pyx_v_self->f_index->arr[__pyx_t_8])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->f_index->arr[__pyx_t_8])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":319 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":319 * for b from 0 <= b < n_f: * i = self.f_index.arr[b] * j = self.f_index.arr[b+1] # <<<<<<<<<<<<<< * self.qsort(i,j, "") * */ - __pyx_t_3 = PyNumber_Add(__pyx_v_b, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromLong((__pyx_v_self->f_index->arr[__pyx_t_8])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_v_b, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->f_index->arr[__pyx_t_8])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2); + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":320 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":320 * i = self.f_index.arr[b] * j = self.f_index.arr[b+1] * self.qsort(i,j, "") # <<<<<<<<<<<<<< * * */ - __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __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 = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->qsort(__pyx_v_self, __pyx_t_20, __pyx_t_24, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_18 = __Pyx_PyInt_AsLong(__pyx_v_b); if (unlikely((__pyx_t_18 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_25 = __Pyx_PyInt_As_int(__pyx_v_j); if (unlikely((__pyx_t_25 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->qsort(__pyx_v_self, __pyx_t_21, __pyx_t_25, __pyx_kp_s__32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_19 = __Pyx_PyInt_As_long(__pyx_v_b); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":317 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":317 * * # Sort buckets by eword * for b from 0 <= b < n_f: # <<<<<<<<<<<<<< * i = self.f_index.arr[b] * j = self.f_index.arr[b+1] */ - __pyx_t_3 = PyInt_FromLong(__pyx_t_18); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_19); 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_XDECREF_SET(__pyx_v_b, __pyx_t_2); + __pyx_t_2 = 0; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":276 + * + * + * def read_text(self, char* filename): # <<<<<<<<<<<<<< + * cdef i, j, w, e_id, f_id, n_f, n_e, N + * cdef IntList fcount + */ + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -17118,7 +18031,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":323 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":323 * * * cdef swap(self, int i, int j): # <<<<<<<<<<<<<< @@ -17134,7 +18047,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 int __pyx_t_1; __Pyx_RefNannySetupContext("swap", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":327 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":327 * cdef float ftmp * * if i == j: # <<<<<<<<<<<<<< @@ -17144,7 +18057,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 __pyx_t_1 = ((__pyx_v_i == __pyx_v_j) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":328 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":328 * * if i == j: * return # <<<<<<<<<<<<<< @@ -17154,11 +18067,9 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":330 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":330 * return * * itmp = self.e_index.arr[i] # <<<<<<<<<<<<<< @@ -17167,7 +18078,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 */ __pyx_v_itmp = (__pyx_v_self->e_index->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":331 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":331 * * itmp = self.e_index.arr[i] * self.e_index.arr[i] = self.e_index.arr[j] # <<<<<<<<<<<<<< @@ -17176,7 +18087,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 */ (__pyx_v_self->e_index->arr[__pyx_v_i]) = (__pyx_v_self->e_index->arr[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":332 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":332 * itmp = self.e_index.arr[i] * self.e_index.arr[i] = self.e_index.arr[j] * self.e_index.arr[j] = itmp # <<<<<<<<<<<<<< @@ -17185,7 +18096,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 */ (__pyx_v_self->e_index->arr[__pyx_v_j]) = __pyx_v_itmp; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":334 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":334 * self.e_index.arr[j] = itmp * * ftmp = self.col1.arr[i] # <<<<<<<<<<<<<< @@ -17194,7 +18105,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 */ __pyx_v_ftmp = (__pyx_v_self->col1->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":335 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":335 * * ftmp = self.col1.arr[i] * self.col1.arr[i] = self.col1.arr[j] # <<<<<<<<<<<<<< @@ -17203,7 +18114,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 */ (__pyx_v_self->col1->arr[__pyx_v_i]) = (__pyx_v_self->col1->arr[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":336 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":336 * ftmp = self.col1.arr[i] * self.col1.arr[i] = self.col1.arr[j] * self.col1.arr[j] = ftmp # <<<<<<<<<<<<<< @@ -17212,7 +18123,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 */ (__pyx_v_self->col1->arr[__pyx_v_j]) = __pyx_v_ftmp; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":338 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":338 * self.col1.arr[j] = ftmp * * ftmp = self.col2.arr[i] # <<<<<<<<<<<<<< @@ -17221,7 +18132,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 */ __pyx_v_ftmp = (__pyx_v_self->col2->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":339 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":339 * * ftmp = self.col2.arr[i] * self.col2.arr[i] = self.col2.arr[j] # <<<<<<<<<<<<<< @@ -17230,7 +18141,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 */ (__pyx_v_self->col2->arr[__pyx_v_i]) = (__pyx_v_self->col2->arr[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":340 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":340 * ftmp = self.col2.arr[i] * self.col2.arr[i] = self.col2.arr[j] * self.col2.arr[j] = ftmp # <<<<<<<<<<<<<< @@ -17239,6 +18150,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 */ (__pyx_v_self->col2->arr[__pyx_v_j]) = __pyx_v_ftmp; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":323 + * + * + * cdef swap(self, int i, int j): # <<<<<<<<<<<<<< + * cdef int itmp + * cdef float ftmp + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -17246,7 +18166,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3 return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":343 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":343 * * * cdef qsort(self, int i, int j, pad): # <<<<<<<<<<<<<< @@ -17269,7 +18189,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("qsort", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":346 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":346 * cdef int pval, p * * if i > j: # <<<<<<<<<<<<<< @@ -17279,23 +18199,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __pyx_t_1 = ((__pyx_v_i > __pyx_v_j) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":347 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":347 * * if i > j: * raise Exception("Sort error in CLex") # <<<<<<<<<<<<<< * if i == j: #empty interval * return */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":348 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":348 * if i > j: * raise Exception("Sort error in CLex") * if i == j: #empty interval # <<<<<<<<<<<<<< @@ -17305,7 +18223,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __pyx_t_1 = ((__pyx_v_i == __pyx_v_j) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":349 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":349 * raise Exception("Sort error in CLex") * if i == j: #empty interval * return # <<<<<<<<<<<<<< @@ -17315,11 +18233,9 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":350 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":350 * if i == j: #empty interval * return * if i == j-1: # singleton interval # <<<<<<<<<<<<<< @@ -17329,7 +18245,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __pyx_t_1 = ((__pyx_v_i == (__pyx_v_j - 1)) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":351 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":351 * return * if i == j-1: # singleton interval * return # <<<<<<<<<<<<<< @@ -17339,11 +18255,9 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L5; } - __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":353 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":353 * return * * p = (i+j)/2 # <<<<<<<<<<<<<< @@ -17352,7 +18266,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ */ __pyx_v_p = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":354 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":354 * * p = (i+j)/2 * pval = self.e_index.arr[p] # <<<<<<<<<<<<<< @@ -17361,7 +18275,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ */ __pyx_v_pval = (__pyx_v_self->e_index->arr[__pyx_v_p]); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":355 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":355 * p = (i+j)/2 * pval = self.e_index.arr[p] * self.swap(i, p) # <<<<<<<<<<<<<< @@ -17372,7 +18286,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":356 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":356 * pval = self.e_index.arr[p] * self.swap(i, p) * p = i # <<<<<<<<<<<<<< @@ -17381,7 +18295,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ */ __pyx_v_p = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":357 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":357 * self.swap(i, p) * p = i * for k from i+1 <= k < j: # <<<<<<<<<<<<<< @@ -17391,7 +18305,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __pyx_t_3 = __pyx_v_j; for (__pyx_v_k = (__pyx_v_i + 1); __pyx_v_k < __pyx_t_3; __pyx_v_k++) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":358 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":358 * p = i * for k from i+1 <= k < j: * if pval >= self.e_index.arr[k]: # <<<<<<<<<<<<<< @@ -17401,7 +18315,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __pyx_t_1 = ((__pyx_v_pval >= (__pyx_v_self->e_index->arr[__pyx_v_k])) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":359 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":359 * for k from i+1 <= k < j: * if pval >= self.e_index.arr[k]: * self.swap(p+1, k) # <<<<<<<<<<<<<< @@ -17412,7 +18326,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":360 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":360 * if pval >= self.e_index.arr[k]: * self.swap(p+1, k) * self.swap(p, p+1) # <<<<<<<<<<<<<< @@ -17423,7 +18337,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":361 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":361 * self.swap(p+1, k) * self.swap(p, p+1) * p = p + 1 # <<<<<<<<<<<<<< @@ -17436,34 +18350,43 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ __pyx_L8:; } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":362 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":362 * self.swap(p, p+1) * p = p + 1 * self.qsort(i,p, pad+" ") # <<<<<<<<<<<<<< * self.qsort(p+1,j, pad+" ") * */ - __pyx_t_2 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_50)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_pad, __pyx_kp_s__34); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 362; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":363 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":363 * p = p + 1 * self.qsort(i,p, pad+" ") * self.qsort(p+1,j, pad+" ") # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_50)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_pad, __pyx_kp_s__34); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 363; __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; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":343 + * + * + * cdef qsort(self, int i, int j, pad): # <<<<<<<<<<<<<< + * cdef int pval, p + * + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -17477,6 +18400,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":366 + * + * + * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * for i in self.f_index: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_17write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_17write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -17497,18 +18428,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_17write_enhanced(PyObject *__pyx return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":366 - * - * - * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< - * with open(filename, "w") as f: - * for i in self.f_index: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_i = NULL; @@ -17530,15 +18455,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *(*__pyx_t_13)(PyObject *); - int __pyx_t_14; - PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":367 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":367 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -17547,23 +18472,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob */ /*with:*/ { __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __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)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__w)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_w); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_w); + __Pyx_GIVEREF(__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[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __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 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __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[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __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; @@ -17578,7 +18503,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":368 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":368 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * for i in self.f_index: # <<<<<<<<<<<<<< @@ -17611,8 +18536,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -17622,45 +18548,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":369 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":369 * with open(filename, "w") as f: * for i in self.f_index: * f.write("%d " % i) # <<<<<<<<<<<<<< * f.write("\n") * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":370 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":370 * for i in self.f_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":371 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":371 * f.write("%d " % i) * f.write("\n") * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): # <<<<<<<<<<<<<< @@ -17678,9 +18604,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __Pyx_INCREF(((PyObject *)__pyx_v_self->col2)); PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_self->col2)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->col2)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_zip, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; @@ -17708,8 +18634,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob } else { __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -17750,8 +18677,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __Pyx_GOTREF(__pyx_t_11); #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 = 371; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); @@ -17781,14 +18707,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __Pyx_XDECREF_SET(__pyx_v_s2, __pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":372 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":372 * f.write("\n") * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) # <<<<<<<<<<<<<< * f.write("\n") * for i, w in enumerate(self.id2fword): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_11); @@ -17801,37 +18727,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __Pyx_INCREF(__pyx_v_s2); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_s2); __Pyx_GIVEREF(__pyx_v_s2); - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_52), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_d_f_f, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":373 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":373 * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) * f.write("\n") # <<<<<<<<<<<<<< * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":374 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":374 * f.write("%d %f %f " % (i, s1, s2)) * f.write("\n") * for i, w in enumerate(self.id2fword): # <<<<<<<<<<<<<< @@ -17866,8 +18792,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob } else { __pyx_t_11 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_11)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -17884,14 +18811,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __pyx_t_1 = __pyx_t_11; __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":375 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":375 * f.write("\n") * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) # <<<<<<<<<<<<<< * f.write("\n") * for i, w in enumerate(self.id2eword): */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); @@ -17901,38 +18828,38 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __Pyx_INCREF(__pyx_v_w); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_w); __Pyx_GIVEREF(__pyx_v_w); - __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_d_s, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":376 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":376 * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_55), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":377 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":377 * f.write("%d %s " % (i, w)) * f.write("\n") * for i, w in enumerate(self.id2eword): # <<<<<<<<<<<<<< @@ -17967,8 +18894,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob } else { __pyx_t_10 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_10)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -17985,14 +18913,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __pyx_t_2 = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":378 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":378 * f.write("\n") * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) # <<<<<<<<<<<<<< * f.write("\n") * */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); @@ -18002,33 +18930,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __Pyx_INCREF(__pyx_v_w); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_w); __Pyx_GIVEREF(__pyx_v_w); - __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_d_s, __pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_11)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":379 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":379 * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_56), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18045,7 +18973,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":367 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":367 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -18058,36 +18986,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_4 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_15 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_15); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__pyx_t_14 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __pyx_t_16 = ((!(__pyx_t_14 != 0)) != 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_15 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_16 = ((!(__pyx_t_15 != 0)) != 0); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_11); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_11 = 0; {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L28; } - __pyx_L28:; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -18108,15 +19025,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob } } /*finally:*/ { - if (__pyx_t_3) { - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_57, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_16 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_3) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__39, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L29; __pyx_L3_error:; @@ -18125,6 +19044,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob __pyx_L29:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":366 + * + * + * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * for i in self.f_index: + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -18147,6 +19075,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":382 + * + * + * def get_score(self, fword, eword, col): # <<<<<<<<<<<<<< + * cdef e_id, f_id, low, high, midpoint, val + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_19get_score(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_19get_score(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -18160,7 +19096,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_19get_score(PyObject *__pyx_v_se __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}; + 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; @@ -18175,15 +19111,15 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_19get_score(PyObject *__pyx_v_se kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fword)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eword)) != 0)) 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 = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__col)) != 0)) 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 = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -18211,18 +19147,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_19get_score(PyObject *__pyx_v_se return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), __pyx_v_fword, __pyx_v_eword, __pyx_v_col); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":382 - * - * - * def get_score(self, fword, eword, col): # <<<<<<<<<<<<<< - * cdef e_id, f_id, low, high, midpoint, val - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cdec_2sa_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; @@ -18242,7 +19172,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_score", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":385 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":385 * cdef e_id, f_id, low, high, midpoint, val * * if eword not in self.eword2id: # <<<<<<<<<<<<<< @@ -18253,7 +19183,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":386 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":386 * * if eword not in self.eword2id: * return None # <<<<<<<<<<<<<< @@ -18264,11 +19194,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":387 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":387 * if eword not in self.eword2id: * return None * if fword not in self.fword2id: # <<<<<<<<<<<<<< @@ -18279,7 +19207,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":388 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":388 * return None * if fword not in self.fword2id: * return None # <<<<<<<<<<<<<< @@ -18290,35 +19218,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":389 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":389 * if fword not in self.fword2id: * return None * f_id = self.fword2id[fword] # <<<<<<<<<<<<<< * e_id = self.eword2id[eword] * low = self.f_index.arr[f_id] */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_self->fword2id, __pyx_v_fword); if (!__pyx_t_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->fword2id, __pyx_v_fword); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_v_f_id = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":390 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":390 * return None * f_id = self.fword2id[fword] * e_id = self.eword2id[eword] # <<<<<<<<<<<<<< * low = self.f_index.arr[f_id] * high = self.f_index.arr[f_id+1] */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_self->eword2id, __pyx_v_eword); if (!__pyx_t_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->eword2id, __pyx_v_eword); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_v_e_id = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":391 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":391 * f_id = self.fword2id[fword] * e_id = self.eword2id[eword] * low = self.f_index.arr[f_id] # <<<<<<<<<<<<<< @@ -18326,12 +19252,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd * while high - low > 0: */ __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong((__pyx_v_self->f_index->arr[__pyx_t_4])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->f_index->arr[__pyx_t_4])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_low = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":392 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":392 * e_id = self.eword2id[eword] * low = self.f_index.arr[f_id] * high = self.f_index.arr[f_id+1] # <<<<<<<<<<<<<< @@ -18342,12 +19268,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromLong((__pyx_v_self->f_index->arr[__pyx_t_4])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->f_index->arr[__pyx_t_4])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_high = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":393 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":393 * low = self.f_index.arr[f_id] * high = self.f_index.arr[f_id+1] * while high - low > 0: # <<<<<<<<<<<<<< @@ -18363,7 +19289,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_1) break; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":394 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":394 * high = self.f_index.arr[f_id+1] * while high - low > 0: * midpoint = (low+high)/2 # <<<<<<<<<<<<<< @@ -18378,7 +19304,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __Pyx_XDECREF_SET(__pyx_v_midpoint, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":395 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":395 * while high - low > 0: * midpoint = (low+high)/2 * val = self.e_index.arr[midpoint] # <<<<<<<<<<<<<< @@ -18386,12 +19312,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd * if col == 0: */ __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_midpoint); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong((__pyx_v_self->e_index->arr[__pyx_t_4])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->e_index->arr[__pyx_t_4])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":396 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":396 * midpoint = (low+high)/2 * val = self.e_index.arr[midpoint] * if val == e_id: # <<<<<<<<<<<<<< @@ -18403,7 +19329,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":397 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":397 * val = self.e_index.arr[midpoint] * if val == e_id: * if col == 0: # <<<<<<<<<<<<<< @@ -18415,7 +19341,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":398 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":398 * if val == e_id: * if col == 0: * return self.col1.arr[midpoint] # <<<<<<<<<<<<<< @@ -18429,11 +19355,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - goto __pyx_L8; } - __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":399 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":399 * if col == 0: * return self.col1.arr[midpoint] * if col == 1: # <<<<<<<<<<<<<< @@ -18445,7 +19369,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":400 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":400 * return self.col1.arr[midpoint] * if col == 1: * return self.col2.arr[midpoint] # <<<<<<<<<<<<<< @@ -18459,14 +19383,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - goto __pyx_L9; } - __pyx_L9:; goto __pyx_L7; } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":401 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":401 * if col == 1: * return self.col2.arr[midpoint] * if val > e_id: # <<<<<<<<<<<<<< @@ -18478,7 +19400,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":402 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":402 * return self.col2.arr[midpoint] * if val > e_id: * high = midpoint # <<<<<<<<<<<<<< @@ -18491,7 +19413,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd } __pyx_L10:; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":403 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":403 * if val > e_id: * high = midpoint * if val < e_id: # <<<<<<<<<<<<<< @@ -18503,7 +19425,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":404 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":404 * high = midpoint * if val < e_id: * low = midpoint + 1 # <<<<<<<<<<<<<< @@ -18519,7 +19441,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __pyx_L11:; } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":405 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":405 * if val < e_id: * low = midpoint + 1 * return None # <<<<<<<<<<<<<< @@ -18531,8 +19453,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd __pyx_r = Py_None; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":382 + * + * + * def get_score(self, fword, eword, col): # <<<<<<<<<<<<<< + * cdef e_id, f_id, low, high, midpoint, val + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); @@ -18550,6 +19479,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":408 + * + * + * def write_text(self, char* filename): # <<<<<<<<<<<<<< + * """Note: does not guarantee writing the dictionary in the original order""" + * cdef i, N, e_id, f_id + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_21write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static char __pyx_doc_4cdec_2sa_3_sa_5BiLex_20write_text[] = "Note: does not guarantee writing the dictionary in the original order"; @@ -18571,18 +19508,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5BiLex_21write_text(PyObject *__pyx_v_s return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":408 - * - * - * def write_text(self, char* filename): # <<<<<<<<<<<<<< - * """Note: does not guarantee writing the dictionary in the original order""" - * cdef i, N, e_id, f_id - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_i = 0; PyObject *__pyx_v_N = 0; @@ -18612,7 +19543,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":412 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":412 * cdef i, N, e_id, f_id * * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -18621,23 +19552,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c */ /*with:*/ { __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __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)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__w)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_w); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_w); + __Pyx_GIVEREF(__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[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __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 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __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[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __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; @@ -18652,7 +19583,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":413 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":413 * * with open(filename, "w") as f: * N = len(self.e_index) # <<<<<<<<<<<<<< @@ -18668,7 +19599,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __pyx_v_N = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":414 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":414 * with open(filename, "w") as f: * N = len(self.e_index) * f_id = 0 # <<<<<<<<<<<<<< @@ -18678,21 +19609,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __Pyx_INCREF(__pyx_int_0); __pyx_v_f_id = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":415 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":415 * N = len(self.e_index) * f_id = 0 * for i from 0 <= i < N: # <<<<<<<<<<<<<< * while self.f_index.arr[f_id+1] == i: * f_id = f_id + 1 */ - __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_v_N); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_9 = __Pyx_PyInt_As_long(__pyx_v_N); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L7_error;} for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10++) { - __pyx_t_4 = PyInt_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":416 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":416 * f_id = 0 * for i from 0 <= i < N: * while self.f_index.arr[f_id+1] == i: # <<<<<<<<<<<<<< @@ -18704,7 +19635,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong((__pyx_v_self->f_index->arr[__pyx_t_8])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->f_index->arr[__pyx_t_8])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -18712,7 +19643,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_11) break; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":417 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":417 * for i from 0 <= i < N: * while self.f_index.arr[f_id+1] == i: * f_id = f_id + 1 # <<<<<<<<<<<<<< @@ -18725,7 +19656,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":418 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":418 * while self.f_index.arr[f_id+1] == i: * f_id = f_id + 1 * e_id = self.e_index.arr[i] # <<<<<<<<<<<<<< @@ -18733,12 +19664,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c * score2 = self.col2.arr[i] */ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_1 = PyInt_FromLong((__pyx_v_self->e_index->arr[__pyx_t_8])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->e_index->arr[__pyx_t_8])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_e_id, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":419 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":419 * f_id = f_id + 1 * e_id = self.e_index.arr[i] * score1 = self.col1.arr[i] # <<<<<<<<<<<<<< @@ -18751,7 +19682,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __Pyx_XDECREF_SET(__pyx_v_score1, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":420 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":420 * e_id = self.e_index.arr[i] * score1 = self.col1.arr[i] * score2 = self.col2.arr[i] # <<<<<<<<<<<<<< @@ -18763,16 +19694,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __Pyx_XDECREF_SET(__pyx_v_score2, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":421 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":421 * score1 = self.col1.arr[i] * score2 = self.col2.arr[i] * f.write("%s %s %.6f %.6f\n" % (self.id2fword[f_id], self.id2eword[e_id], score1, score2)) # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetItem(__pyx_v_self->id2fword, __pyx_v_f_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->id2fword, __pyx_v_f_id); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_GetItem(__pyx_v_self->id2eword, __pyx_v_e_id); if (!__pyx_t_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_self->id2eword, __pyx_v_e_id); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); @@ -18788,30 +19719,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __Pyx_GIVEREF(__pyx_v_score2); __pyx_t_4 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_58), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s_6f_6f, __pyx_t_12); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_v_i); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_i); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":415 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":415 * N = len(self.e_index) * f_id = 0 * for i from 0 <= i < N: # <<<<<<<<<<<<<< * while self.f_index.arr[f_id+1] == i: * f_id = f_id + 1 */ - __pyx_t_2 = PyInt_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; @@ -18826,7 +19757,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":412 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":412 * cdef i, N, e_id, f_id * * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -18839,19 +19770,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_4 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_13 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); @@ -18861,14 +19784,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestore(__pyx_t_2, __pyx_t_12, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_12 = 0; __pyx_t_1 = 0; {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L22; } - __pyx_L22:; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18889,15 +19809,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c } } /*finally:*/ { - if (__pyx_t_3) { - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_59, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_14 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_3) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__40, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L23; __pyx_L3_error:; @@ -18906,6 +19828,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c __pyx_L23:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":408 + * + * + * def write_text(self, char* filename): # <<<<<<<<<<<<<< + * """Note: does not guarantee writing the dictionary in the original order""" + * cdef i, N, e_id, f_id + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -18928,7 +19859,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":21 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":21 * cdef int LOWER_MASK[32] * * cdef void _init_lower_mask(): # <<<<<<<<<<<<<< @@ -18944,7 +19875,7 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) { unsigned int __pyx_t_2; __Pyx_RefNannySetupContext("_init_lower_mask", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":23 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":23 * cdef void _init_lower_mask(): * cdef unsigned i * cdef int mask = 0 # <<<<<<<<<<<<<< @@ -18953,7 +19884,7 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) { */ __pyx_v_mask = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":24 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":24 * cdef unsigned i * cdef int mask = 0 * for i in range(MIN_BOTTOM_SIZE): # <<<<<<<<<<<<<< @@ -18964,7 +19895,7 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) { for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":25 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":25 * cdef int mask = 0 * for i in range(MIN_BOTTOM_SIZE): * mask = (mask << 1) + 1 # <<<<<<<<<<<<<< @@ -18973,7 +19904,7 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) { */ __pyx_v_mask = ((__pyx_v_mask << 1) + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":26 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":26 * for i in range(MIN_BOTTOM_SIZE): * mask = (mask << 1) + 1 * LOWER_MASK[i] = mask # <<<<<<<<<<<<<< @@ -18983,10 +19914,19 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) { (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[__pyx_v_i]) = __pyx_v_mask; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":21 + * cdef int LOWER_MASK[32] + * + * cdef void _init_lower_mask(): # <<<<<<<<<<<<<< + * cdef unsigned i + * cdef int mask = 0 + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":37 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":37 * * * cdef _BitSet* new_BitSet(): # <<<<<<<<<<<<<< @@ -19000,7 +19940,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet( __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_BitSet", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":40 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":40 * cdef _BitSet* b * * b = <_BitSet*> malloc(sizeof(_BitSet)) # <<<<<<<<<<<<<< @@ -19009,7 +19949,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet( */ __pyx_v_b = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)malloc((sizeof(struct __pyx_t_4cdec_2sa_3_sa__BitSet)))); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":41 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":41 * * b = <_BitSet*> malloc(sizeof(_BitSet)) * b.bitset = 0 # <<<<<<<<<<<<<< @@ -19018,7 +19958,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet( */ __pyx_v_b->bitset = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":42 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":42 * b = <_BitSet*> malloc(sizeof(_BitSet)) * b.bitset = 0 * b.min_val = -1 # <<<<<<<<<<<<<< @@ -19027,7 +19967,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet( */ __pyx_v_b->min_val = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":43 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":43 * b.bitset = 0 * b.min_val = -1 * b.max_val = -1 # <<<<<<<<<<<<<< @@ -19036,7 +19976,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet( */ __pyx_v_b->max_val = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":44 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":44 * b.min_val = -1 * b.max_val = -1 * b.size = 0 # <<<<<<<<<<<<<< @@ -19045,7 +19985,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet( */ __pyx_v_b->size = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":45 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":45 * b.max_val = -1 * b.size = 0 * return b # <<<<<<<<<<<<<< @@ -19055,13 +19995,21 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet( __pyx_r = __pyx_v_b; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":37 + * + * + * cdef _BitSet* new_BitSet(): # <<<<<<<<<<<<<< + * cdef _BitSet* b + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":48 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":48 * * * cdef int bitset_findsucc(_BitSet* b, int i): # <<<<<<<<<<<<<< @@ -19082,7 +20030,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ int __pyx_t_3; __Pyx_RefNannySetupContext("bitset_findsucc", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":52 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":52 * cdef int low, high, mid * * if b.max_val == -1 or i >= b.max_val: # <<<<<<<<<<<<<< @@ -19098,7 +20046,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":53 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":53 * * if b.max_val == -1 or i >= b.max_val: * return -1 # <<<<<<<<<<<<<< @@ -19107,11 +20055,9 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ */ __pyx_r = -1; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":54 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":54 * if b.max_val == -1 or i >= b.max_val: * return -1 * if i < b.min_val: # <<<<<<<<<<<<<< @@ -19121,7 +20067,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ __pyx_t_3 = ((__pyx_v_i < __pyx_v_b->min_val) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":55 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":55 * return -1 * if i < b.min_val: * return b.min_val # <<<<<<<<<<<<<< @@ -19130,11 +20076,9 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ */ __pyx_r = __pyx_v_b->min_val; goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":57 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":57 * return b.min_val * * bitset = b.bitset & ~LOWER_MASK[i] # <<<<<<<<<<<<<< @@ -19143,7 +20087,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ */ __pyx_v_bitset = (__pyx_v_b->bitset & (~(__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[__pyx_v_i]))); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":58 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":58 * * bitset = b.bitset & ~LOWER_MASK[i] * low = i+1 # <<<<<<<<<<<<<< @@ -19152,7 +20096,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ */ __pyx_v_low = (__pyx_v_i + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":59 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":59 * bitset = b.bitset & ~LOWER_MASK[i] * low = i+1 * high = b.max_val+1 # <<<<<<<<<<<<<< @@ -19161,7 +20105,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ */ __pyx_v_high = (__pyx_v_b->max_val + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":60 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":60 * low = i+1 * high = b.max_val+1 * while low < high-1: # <<<<<<<<<<<<<< @@ -19172,7 +20116,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ __pyx_t_3 = ((__pyx_v_low < (__pyx_v_high - 1)) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":61 * high = b.max_val+1 * while low < high-1: * mid = (high + low)/2 # <<<<<<<<<<<<<< @@ -19181,7 +20125,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ */ __pyx_v_mid = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":62 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":62 * while low < high-1: * mid = (high + low)/2 * mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) # <<<<<<<<<<<<<< @@ -19190,7 +20134,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ */ __pyx_v_mask = (~((__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[(__pyx_v_high - 1)]) ^ (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[(__pyx_v_mid - 1)]))); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":63 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":63 * mid = (high + low)/2 * mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) * if bitset & mask == 0: # <<<<<<<<<<<<<< @@ -19200,7 +20144,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ __pyx_t_3 = (((__pyx_v_bitset & __pyx_v_mask) == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":64 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":64 * mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) * if bitset & mask == 0: * low = mid # <<<<<<<<<<<<<< @@ -19212,7 +20156,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":66 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":66 * low = mid * else: * bitset = bitset & mask # <<<<<<<<<<<<<< @@ -19221,7 +20165,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ */ __pyx_v_bitset = (__pyx_v_bitset & __pyx_v_mask); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":67 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":67 * else: * bitset = bitset & mask * high = mid # <<<<<<<<<<<<<< @@ -19233,7 +20177,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ __pyx_L7:; } - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":68 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":68 * bitset = bitset & mask * high = mid * return low # <<<<<<<<<<<<<< @@ -19243,13 +20187,21 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_ __pyx_r = __pyx_v_low; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":48 + * + * + * cdef int bitset_findsucc(_BitSet* b, int i): # <<<<<<<<<<<<<< + * cdef int bitset, mask + * cdef int low, high, mid + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":71 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":71 * * * cdef int bitset_insert(_BitSet* b, int i): # <<<<<<<<<<<<<< @@ -19264,7 +20216,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B int __pyx_t_1; __Pyx_RefNannySetupContext("bitset_insert", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":74 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":74 * cdef int val * * val = 1 << i # <<<<<<<<<<<<<< @@ -19273,7 +20225,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B */ __pyx_v_val = (1 << __pyx_v_i); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":75 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":75 * * val = 1 << i * if b.bitset & val == 0: # <<<<<<<<<<<<<< @@ -19283,7 +20235,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B __pyx_t_1 = (((__pyx_v_b->bitset & __pyx_v_val) == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":76 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":76 * val = 1 << i * if b.bitset & val == 0: * b.bitset = b.bitset | val # <<<<<<<<<<<<<< @@ -19292,7 +20244,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B */ __pyx_v_b->bitset = (__pyx_v_b->bitset | __pyx_v_val); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":77 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":77 * if b.bitset & val == 0: * b.bitset = b.bitset | val * if b.size == 0: # <<<<<<<<<<<<<< @@ -19302,7 +20254,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B __pyx_t_1 = ((__pyx_v_b->size == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":78 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":78 * b.bitset = b.bitset | val * if b.size == 0: * b.min_val = i # <<<<<<<<<<<<<< @@ -19311,7 +20263,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B */ __pyx_v_b->min_val = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":79 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":79 * if b.size == 0: * b.min_val = i * b.max_val = i # <<<<<<<<<<<<<< @@ -19323,7 +20275,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":81 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":81 * b.max_val = i * else: * if i < b.min_val: # <<<<<<<<<<<<<< @@ -19333,7 +20285,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B __pyx_t_1 = ((__pyx_v_i < __pyx_v_b->min_val) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":82 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":82 * else: * if i < b.min_val: * b.min_val = i # <<<<<<<<<<<<<< @@ -19345,7 +20297,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":83 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":83 * if i < b.min_val: * b.min_val = i * if i > b.max_val: # <<<<<<<<<<<<<< @@ -19355,7 +20307,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B __pyx_t_1 = ((__pyx_v_i > __pyx_v_b->max_val) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":84 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":84 * b.min_val = i * if i > b.max_val: * b.max_val = i # <<<<<<<<<<<<<< @@ -19369,7 +20321,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":85 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":85 * if i > b.max_val: * b.max_val = i * b.size = b.size + 1 # <<<<<<<<<<<<<< @@ -19378,7 +20330,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B */ __pyx_v_b->size = (__pyx_v_b->size + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":86 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":86 * b.max_val = i * b.size = b.size + 1 * return 1 # <<<<<<<<<<<<<< @@ -19387,11 +20339,9 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":87 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":87 * b.size = b.size + 1 * return 1 * return 0 # <<<<<<<<<<<<<< @@ -19401,13 +20351,21 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B __pyx_r = 0; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":71 + * + * + * cdef int bitset_insert(_BitSet* b, int i): # <<<<<<<<<<<<<< + * cdef int val + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":90 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":90 * * * cdef int bitset_contains(_BitSet* b, int i): # <<<<<<<<<<<<<< @@ -19422,7 +20380,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_ int __pyx_t_1; __Pyx_RefNannySetupContext("bitset_contains", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":93 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":93 * cdef int val * * val = 1 << i # <<<<<<<<<<<<<< @@ -19431,7 +20389,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_ */ __pyx_v_val = (1 << __pyx_v_i); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":94 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":94 * * val = 1 << i * if b.bitset & val == 0: # <<<<<<<<<<<<<< @@ -19441,7 +20399,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_ __pyx_t_1 = (((__pyx_v_b->bitset & __pyx_v_val) == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":95 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":95 * val = 1 << i * if b.bitset & val == 0: * return 0 # <<<<<<<<<<<<<< @@ -19450,11 +20408,10 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_ */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":97 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":97 * return 0 * else: * return 1 # <<<<<<<<<<<<<< @@ -19464,14 +20421,29 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_ __pyx_r = 1; goto __pyx_L0; } - __pyx_L3:; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":90 + * + * + * cdef int bitset_contains(_BitSet* b, int i): # <<<<<<<<<<<<<< + * cdef int val + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":104 + * cdef int next_val + * + * def __next__(self): # <<<<<<<<<<<<<< + * cdef int ret_val + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14BitSetIterator_1__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14BitSetIterator_1__next__(PyObject *__pyx_v_self) { @@ -19479,18 +20451,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14BitSetIterator_1__next__(PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(((struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":104 - * cdef int next_val - * - * def __next__(self): # <<<<<<<<<<<<<< - * cdef int ret_val - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator *__pyx_v_self) { int __pyx_v_ret_val; PyObject *__pyx_r = NULL; @@ -19503,7 +20469,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":107 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":107 * cdef int ret_val * * if self.next_val == -1: # <<<<<<<<<<<<<< @@ -19513,23 +20479,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_ __pyx_t_1 = ((__pyx_v_self->next_val == -1) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":108 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":108 * * if self.next_val == -1: * raise StopIteration() # <<<<<<<<<<<<<< * ret_val = self.next_val * self.next_val = bitset_findsucc(self.b, ret_val) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_StopIteration, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[6]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":109 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":109 * if self.next_val == -1: * raise StopIteration() * ret_val = self.next_val # <<<<<<<<<<<<<< @@ -19539,7 +20503,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_ __pyx_t_3 = __pyx_v_self->next_val; __pyx_v_ret_val = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":110 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":110 * raise StopIteration() * ret_val = self.next_val * self.next_val = bitset_findsucc(self.b, ret_val) # <<<<<<<<<<<<<< @@ -19548,7 +20512,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_ */ __pyx_v_self->next_val = __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(__pyx_v_self->b, __pyx_v_ret_val); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":111 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":111 * ret_val = self.next_val * self.next_val = bitset_findsucc(self.b, ret_val) * return ret_val # <<<<<<<<<<<<<< @@ -19556,14 +20520,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromLong(__pyx_v_ret_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":104 + * cdef int next_val + * + * def __next__(self): # <<<<<<<<<<<<<< + * cdef int ret_val + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.BitSetIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -19574,6 +20545,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":122 + * cdef _BitSet* b + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.b = new_BitSet() + * + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -19584,24 +20563,18 @@ static int __pyx_pw_4cdec_2sa_3_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, Py __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_4cdec_2sa_3_sa_6BitSet___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_BitSet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":122 - * cdef _BitSet* b - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.b = new_BitSet() - * - */ - static int __pyx_pf_4cdec_2sa_3_sa_6BitSet___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_BitSet *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":123 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":123 * * def __cinit__(self): * self.b = new_BitSet() # <<<<<<<<<<<<<< @@ -19610,33 +20583,44 @@ static int __pyx_pf_4cdec_2sa_3_sa_6BitSet___cinit__(struct __pyx_obj_4cdec_2sa_ */ __pyx_v_self->b = __pyx_f_4cdec_2sa_3_sa_new_BitSet(); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":122 + * cdef _BitSet* b + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.b = new_BitSet() + * + */ + + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":125 + * self.b = new_BitSet() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.b) + * + */ + /* Python wrapper */ static void __pyx_pw_4cdec_2sa_3_sa_6BitSet_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4cdec_2sa_3_sa_6BitSet_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_4cdec_2sa_3_sa_6BitSet_2__dealloc__(((struct __pyx_obj_4cdec_2sa_3_sa_BitSet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":125 - * self.b = new_BitSet() - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self.b) - * - */ - static void __pyx_pf_4cdec_2sa_3_sa_6BitSet_2__dealloc__(struct __pyx_obj_4cdec_2sa_3_sa_BitSet *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":126 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":126 * * def __dealloc__(self): * free(self.b) # <<<<<<<<<<<<<< @@ -19645,9 +20629,26 @@ static void __pyx_pf_4cdec_2sa_3_sa_6BitSet_2__dealloc__(struct __pyx_obj_4cdec_ */ free(__pyx_v_self->b); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":125 + * self.b = new_BitSet() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.b) + * + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":128 + * free(self.b) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef BitSetIterator it + * it = BitSetIterator() + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_5__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_5__iter__(PyObject *__pyx_v_self) { @@ -19655,18 +20656,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_5__iter__(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(((struct __pyx_obj_4cdec_2sa_3_sa_BitSet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":128 - * free(self.b) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * cdef BitSetIterator it - * it = BitSetIterator() - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cdec_2sa_3_sa_BitSet *__pyx_v_self) { struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator *__pyx_v_it = 0; PyObject *__pyx_r = NULL; @@ -19679,19 +20674,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":130 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":130 * def __iter__(self): * cdef BitSetIterator it * it = BitSetIterator() # <<<<<<<<<<<<<< * it.b = self.b * it.next_val = self.b.min_val */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_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_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_BitSetIterator)), __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_4cdec_2sa_3_sa_BitSetIterator *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":131 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":131 * cdef BitSetIterator it * it = BitSetIterator() * it.b = self.b # <<<<<<<<<<<<<< @@ -19701,7 +20696,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde __pyx_t_2 = __pyx_v_self->b; __pyx_v_it->b = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":132 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":132 * it = BitSetIterator() * it.b = self.b * it.next_val = self.b.min_val # <<<<<<<<<<<<<< @@ -19711,7 +20706,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde __pyx_t_3 = __pyx_v_self->b->min_val; __pyx_v_it->next_val = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":133 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":133 * it.b = self.b * it.next_val = self.b.min_val * return it # <<<<<<<<<<<<<< @@ -19723,8 +20718,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde __pyx_r = ((PyObject *)__pyx_v_it); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":128 + * free(self.b) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef BitSetIterator it + * it = BitSetIterator() + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.BitSet.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -19736,6 +20738,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":135 + * return it + * + * def insert(self, i): # <<<<<<<<<<<<<< + * return bitset_insert(self.b, i) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -19743,18 +20753,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_7insert(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insert (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6BitSet_6insert(((struct __pyx_obj_4cdec_2sa_3_sa_BitSet *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":135 - * return it - * - * def insert(self, i): # <<<<<<<<<<<<<< - * return bitset_insert(self.b, i) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_6insert(struct __pyx_obj_4cdec_2sa_3_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -19765,7 +20769,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_6insert(struct __pyx_obj_4cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insert", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":136 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":136 * * def insert(self, i): * return bitset_insert(self.b, i) # <<<<<<<<<<<<<< @@ -19773,15 +20777,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_6insert(struct __pyx_obj_4cdec_ * def findsucc(self, i): */ __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_4cdec_2sa_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_t_1 = __Pyx_PyInt_As_int(__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 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_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; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":135 + * return it + * + * def insert(self, i): # <<<<<<<<<<<<<< + * return bitset_insert(self.b, i) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.BitSet.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -19792,6 +20803,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_6insert(struct __pyx_obj_4cdec_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":138 + * return bitset_insert(self.b, i) + * + * def findsucc(self, i): # <<<<<<<<<<<<<< + * return bitset_findsucc(self.b, i) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -19799,18 +20818,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_9findsucc(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("findsucc (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6BitSet_8findsucc(((struct __pyx_obj_4cdec_2sa_3_sa_BitSet *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":138 - * return bitset_insert(self.b, i) - * - * def findsucc(self, i): # <<<<<<<<<<<<<< - * return bitset_findsucc(self.b, i) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_8findsucc(struct __pyx_obj_4cdec_2sa_3_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -19821,7 +20834,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_8findsucc(struct __pyx_obj_4cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("findsucc", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":139 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":139 * * def findsucc(self, i): * return bitset_findsucc(self.b, i) # <<<<<<<<<<<<<< @@ -19829,15 +20842,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_8findsucc(struct __pyx_obj_4cde * def __str__(self): */ __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_4cdec_2sa_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_t_1 = __Pyx_PyInt_As_int(__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 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_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; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":138 + * return bitset_insert(self.b, i) + * + * def findsucc(self, i): # <<<<<<<<<<<<<< + * return bitset_findsucc(self.b, i) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.BitSet.findsucc", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -19848,6 +20868,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_8findsucc(struct __pyx_obj_4cde return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":141 + * return bitset_findsucc(self.b, i) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")" + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_11__str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_11__str__(PyObject *__pyx_v_self) { @@ -19855,18 +20883,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_11__str__(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6BitSet_10__str__(((struct __pyx_obj_4cdec_2sa_3_sa_BitSet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":141 - * return bitset_findsucc(self.b, i) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")" - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_10__str__(struct __pyx_obj_4cdec_2sa_3_sa_BitSet *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -19878,7 +20900,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_10__str__(struct __pyx_obj_4cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":142 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":142 * * def __str__(self): * return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")" # <<<<<<<<<<<<<< @@ -19886,68 +20908,75 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_10__str__(struct __pyx_obj_4cde * def min(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_4cdec_2sa_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_t_1 = __pyx_f_4cdec_2sa_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_60)); 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)); + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__41); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->b->size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->b->size); 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_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __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[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); 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_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_t_2), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromLong(__pyx_v_self->b->min_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->b->min_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); 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*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __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_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __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_self->b->max_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->b->max_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __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[6]; __pyx_lineno = 142; __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(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__42); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __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; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":141 + * return bitset_findsucc(self.b, i) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")" + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -19960,6 +20989,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_10__str__(struct __pyx_obj_4cde return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":144 + * return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")" + * + * def min(self): # <<<<<<<<<<<<<< + * return self.b.min_val + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_13min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_13min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { @@ -19967,18 +21004,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_13min(PyObject *__pyx_v_self, C __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("min (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6BitSet_12min(((struct __pyx_obj_4cdec_2sa_3_sa_BitSet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":144 - * return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")" - * - * def min(self): # <<<<<<<<<<<<<< - * return self.b.min_val - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_12min(struct __pyx_obj_4cdec_2sa_3_sa_BitSet *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -19988,7 +21019,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_12min(struct __pyx_obj_4cdec_2s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("min", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":145 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":145 * * def min(self): * return self.b.min_val # <<<<<<<<<<<<<< @@ -19996,14 +21027,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_12min(struct __pyx_obj_4cdec_2s * def max(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->b->min_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->b->min_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 145; __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; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":144 + * return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")" + * + * def min(self): # <<<<<<<<<<<<<< + * return self.b.min_val + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.BitSet.min", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -20014,6 +21052,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_12min(struct __pyx_obj_4cdec_2s return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":147 + * return self.b.min_val + * + * def max(self): # <<<<<<<<<<<<<< + * return self.b.max_val + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_15max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_15max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { @@ -20021,18 +21067,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6BitSet_15max(PyObject *__pyx_v_self, C __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("max (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6BitSet_14max(((struct __pyx_obj_4cdec_2sa_3_sa_BitSet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":147 - * return self.b.min_val - * - * def max(self): # <<<<<<<<<<<<<< - * return self.b.max_val - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_14max(struct __pyx_obj_4cdec_2sa_3_sa_BitSet *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -20042,7 +21082,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_14max(struct __pyx_obj_4cdec_2s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("max", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":148 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":148 * * def max(self): * return self.b.max_val # <<<<<<<<<<<<<< @@ -20050,14 +21090,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_14max(struct __pyx_obj_4cdec_2s * def __len__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->b->max_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->b->max_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __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); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":147 + * return self.b.min_val + * + * def max(self): # <<<<<<<<<<<<<< + * return self.b.max_val + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.BitSet.max", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -20068,6 +21115,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_14max(struct __pyx_obj_4cdec_2s return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":150 + * return self.b.max_val + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.b.size + * + */ + /* Python wrapper */ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_6BitSet_17__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_6BitSet_17__len__(PyObject *__pyx_v_self) { @@ -20075,24 +21130,18 @@ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_6BitSet_17__len__(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6BitSet_16__len__(((struct __pyx_obj_4cdec_2sa_3_sa_BitSet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":150 - * return self.b.max_val - * - * def __len__(self): # <<<<<<<<<<<<<< - * return self.b.size - * - */ - static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_6BitSet_16__len__(struct __pyx_obj_4cdec_2sa_3_sa_BitSet *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":151 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":151 * * def __len__(self): * return self.b.size # <<<<<<<<<<<<<< @@ -20102,12 +21151,28 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_6BitSet_16__len__(struct __pyx_obj_4cd __pyx_r = __pyx_v_self->b->size; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":150 + * return self.b.max_val + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.b.size + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":153 + * return self.b.size + * + * def __contains__(self, i): # <<<<<<<<<<<<<< + * return bool(bitset_contains(self.b, i)) + * + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_6BitSet_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_6BitSet_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -20115,18 +21180,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_6BitSet_19__contains__(PyObject *__pyx_v_self __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6BitSet_18__contains__(((struct __pyx_obj_4cdec_2sa_3_sa_BitSet *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":153 - * return self.b.size - * - * def __contains__(self, i): # <<<<<<<<<<<<<< - * return bool(bitset_contains(self.b, i)) - * - */ - static int __pyx_pf_4cdec_2sa_3_sa_6BitSet_18__contains__(struct __pyx_obj_4cdec_2sa_3_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i) { int __pyx_r; __Pyx_RefNannyDeclarations @@ -20138,23 +21197,30 @@ static int __pyx_pf_4cdec_2sa_3_sa_6BitSet_18__contains__(struct __pyx_obj_4cdec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":154 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":154 * * def __contains__(self, i): * return bool(bitset_contains(self.b, 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 = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_f_4cdec_2sa_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_t_1 = __Pyx_PyInt_As_int(__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 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_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; __pyx_r = (!(!__pyx_t_3)); goto __pyx_L0; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":153 + * return self.b.size + * + * def __contains__(self, i): # <<<<<<<<<<<<<< + * return bool(bitset_contains(self.b, i)) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.BitSet.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -20164,7 +21230,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6BitSet_18__contains__(struct __pyx_obj_4cdec return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":157 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":157 * * * cdef str dec2bin(long i): # <<<<<<<<<<<<<< @@ -20186,17 +21252,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dec2bin", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":158 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":158 * * cdef str dec2bin(long i): * cdef str result = "" # <<<<<<<<<<<<<< * cdef unsigned d * for d in range(MIN_BOTTOM_SIZE): */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_47)); - __pyx_v_result = __pyx_kp_s_47; + __Pyx_INCREF(__pyx_kp_s__32); + __pyx_v_result = __pyx_kp_s__32; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":160 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":160 * cdef str result = "" * cdef unsigned d * for d in range(MIN_BOTTOM_SIZE): # <<<<<<<<<<<<<< @@ -20207,7 +21273,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) { for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_d = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":161 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":161 * cdef unsigned d * for d in range(MIN_BOTTOM_SIZE): * if i & LOWER_MASK[0] == 0: # <<<<<<<<<<<<<< @@ -20217,36 +21283,36 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) { __pyx_t_3 = (((__pyx_v_i & (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[0])) == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":162 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":162 * for d in range(MIN_BOTTOM_SIZE): * if i & LOWER_MASK[0] == 0: * result = "0"+result # <<<<<<<<<<<<<< * else: * result = "1"+result */ - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s__0), ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyNumber_Add(__pyx_kp_s_0, __pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; goto __pyx_L5; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":164 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":164 * result = "0"+result * else: * result = "1"+result # <<<<<<<<<<<<<< * i = i >> 1 * return result */ - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s__1), ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyNumber_Add(__pyx_kp_s_1, __pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":165 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":165 * else: * result = "1"+result * i = i >> 1 # <<<<<<<<<<<<<< @@ -20256,20 +21322,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) { __pyx_v_i = (__pyx_v_i >> 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":166 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":166 * result = "1"+result * i = i >> 1 * return result # <<<<<<<<<<<<<< * * cdef struct _VEB: */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":157 + * + * + * cdef str dec2bin(long i): # <<<<<<<<<<<<<< + * cdef str result = "" + * cdef unsigned d + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cdec.sa._sa.dec2bin", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -20281,7 +21354,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) { return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":177 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":177 * void** bottom * * cdef _VEB* new_VEB(int n): # <<<<<<<<<<<<<< @@ -20302,7 +21375,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_VEB", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":181 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":181 * cdef int num_bits, num_top_bits, i * * veb = <_VEB*> malloc(sizeof(_VEB)) # <<<<<<<<<<<<<< @@ -20311,7 +21384,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ */ __pyx_v_veb = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)malloc((sizeof(struct __pyx_t_4cdec_2sa_3_sa__VEB)))); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":183 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":183 * veb = <_VEB*> malloc(sizeof(_VEB)) * * num_bits = int(ceil(log(n) / log(2))) # <<<<<<<<<<<<<< @@ -20324,7 +21397,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif @@ -20332,7 +21405,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ } __pyx_v_num_bits = ((int)ceil((__pyx_t_1 / __pyx_t_2))); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":184 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":184 * * num_bits = int(ceil(log(n) / log(2))) * veb.num_bottom_bits = num_bits/2 # <<<<<<<<<<<<<< @@ -20341,7 +21414,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ */ __pyx_v_veb->num_bottom_bits = __Pyx_div_long(__pyx_v_num_bits, 2); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":185 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":185 * num_bits = int(ceil(log(n) / log(2))) * veb.num_bottom_bits = num_bits/2 * if veb.num_bottom_bits < MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20351,7 +21424,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ __pyx_t_3 = ((__pyx_v_veb->num_bottom_bits < __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":186 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":186 * veb.num_bottom_bits = num_bits/2 * if veb.num_bottom_bits < MIN_BOTTOM_BITS: * veb.num_bottom_bits = MIN_BOTTOM_BITS # <<<<<<<<<<<<<< @@ -20363,7 +21436,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":187 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":187 * if veb.num_bottom_bits < MIN_BOTTOM_BITS: * veb.num_bottom_bits = MIN_BOTTOM_BITS * veb.top_universe_size = (n >> veb.num_bottom_bits) + 1 # <<<<<<<<<<<<<< @@ -20372,7 +21445,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ */ __pyx_v_veb->top_universe_size = ((__pyx_v_n >> __pyx_v_veb->num_bottom_bits) + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":189 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":189 * veb.top_universe_size = (n >> veb.num_bottom_bits) + 1 * * veb.bottom = malloc(veb.top_universe_size * sizeof(void*)) # <<<<<<<<<<<<<< @@ -20381,7 +21454,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ */ __pyx_v_veb->bottom = ((void **)malloc((__pyx_v_veb->top_universe_size * (sizeof(void *))))); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":190 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":190 * * veb.bottom = malloc(veb.top_universe_size * sizeof(void*)) * memset(veb.bottom, 0, veb.top_universe_size * sizeof(void*)) # <<<<<<<<<<<<<< @@ -20390,7 +21463,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ */ memset(__pyx_v_veb->bottom, 0, (__pyx_v_veb->top_universe_size * (sizeof(void *)))); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":192 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":192 * memset(veb.bottom, 0, veb.top_universe_size * sizeof(void*)) * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20400,7 +21473,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ __pyx_t_3 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":193 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":193 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * veb.top = new_VEB(veb.top_universe_size) # <<<<<<<<<<<<<< @@ -20412,7 +21485,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":195 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":195 * veb.top = new_VEB(veb.top_universe_size) * else: * veb.top = new_BitSet() # <<<<<<<<<<<<<< @@ -20423,7 +21496,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":197 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":197 * veb.top = new_BitSet() * * veb.max_val = -1 # <<<<<<<<<<<<<< @@ -20432,7 +21505,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ */ __pyx_v_veb->max_val = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":198 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":198 * * veb.max_val = -1 * veb.min_val = -1 # <<<<<<<<<<<<<< @@ -20441,7 +21514,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ */ __pyx_v_veb->min_val = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":199 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":199 * veb.max_val = -1 * veb.min_val = -1 * veb.size = 0 # <<<<<<<<<<<<<< @@ -20450,7 +21523,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ */ __pyx_v_veb->size = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":200 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":200 * veb.min_val = -1 * veb.size = 0 * return veb # <<<<<<<<<<<<<< @@ -20460,17 +21533,24 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __ __pyx_r = __pyx_v_veb; goto __pyx_L0; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":177 + * void** bottom + * + * cdef _VEB* new_VEB(int n): # <<<<<<<<<<<<<< + * cdef _VEB* veb + * cdef int num_bits, num_top_bits, i + */ + + /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("cdec.sa._sa.new_VEB", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.new_VEB", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":203 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":203 * * * cdef int VEB_insert(_VEB* veb, int i): # <<<<<<<<<<<<<< @@ -20492,7 +21572,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB int __pyx_t_4; __Pyx_RefNannySetupContext("VEB_insert", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":208 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":208 * cdef int a, b, tmp * * if veb.size == 0: # <<<<<<<<<<<<<< @@ -20502,7 +21582,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_t_1 = ((__pyx_v_veb->size == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":209 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":209 * * if veb.size == 0: * veb.min_val = i # <<<<<<<<<<<<<< @@ -20511,7 +21591,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_v_veb->min_val = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":210 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":210 * if veb.size == 0: * veb.min_val = i * veb.max_val = i # <<<<<<<<<<<<<< @@ -20522,7 +21602,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":211 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":211 * veb.min_val = i * veb.max_val = i * elif i == veb.min_val or i == veb.max_val: # <<<<<<<<<<<<<< @@ -20538,7 +21618,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":212 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":212 * veb.max_val = i * elif i == veb.min_val or i == veb.max_val: * return 0 # <<<<<<<<<<<<<< @@ -20547,11 +21627,10 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":214 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":214 * return 0 * else: * if i < veb.min_val: # <<<<<<<<<<<<<< @@ -20561,7 +21640,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_t_3 = ((__pyx_v_i < __pyx_v_veb->min_val) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":215 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":215 * else: * if i < veb.min_val: * tmp = i # <<<<<<<<<<<<<< @@ -20570,7 +21649,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_v_tmp = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":216 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":216 * if i < veb.min_val: * tmp = i * i = veb.min_val # <<<<<<<<<<<<<< @@ -20580,7 +21659,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_t_4 = __pyx_v_veb->min_val; __pyx_v_i = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":217 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":217 * tmp = i * i = veb.min_val * veb.min_val = tmp # <<<<<<<<<<<<<< @@ -20592,7 +21671,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":218 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":218 * i = veb.min_val * veb.min_val = tmp * a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<< @@ -20601,7 +21680,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":219 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":219 * veb.min_val = tmp * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<< @@ -20610,7 +21689,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_v_b = (__pyx_v_i & (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":220 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":220 * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] * if veb.bottom[a] == NULL: # <<<<<<<<<<<<<< @@ -20620,7 +21699,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_t_3 = (((__pyx_v_veb->bottom[__pyx_v_a]) == NULL) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":221 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":221 * b = i & LOWER_MASK[veb.num_bottom_bits-1] * if veb.bottom[a] == NULL: * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20630,7 +21709,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_t_3 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":222 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":222 * if veb.bottom[a] == NULL: * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top # <<<<<<<<<<<<<< @@ -20639,7 +21718,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)__pyx_v_veb->top); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":223 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":223 * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top * VEB_insert(subv, a) # <<<<<<<<<<<<<< @@ -20651,7 +21730,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":225 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":225 * VEB_insert(subv, a) * else: * subb = <_BitSet*> veb.top # <<<<<<<<<<<<<< @@ -20660,7 +21739,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)__pyx_v_veb->top); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":226 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":226 * else: * subb = <_BitSet*> veb.top * bitset_insert(subb, a) # <<<<<<<<<<<<<< @@ -20671,7 +21750,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":227 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":227 * subb = <_BitSet*> veb.top * bitset_insert(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20681,7 +21760,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_t_3 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":228 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":228 * bitset_insert(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * veb.bottom[a] = new_VEB(1 << veb.num_bottom_bits) # <<<<<<<<<<<<<< @@ -20693,7 +21772,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":230 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":230 * veb.bottom[a] = new_VEB(1 << veb.num_bottom_bits) * else: * veb.bottom[a] = new_BitSet() # <<<<<<<<<<<<<< @@ -20707,7 +21786,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":231 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":231 * else: * veb.bottom[a] = new_BitSet() * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20717,7 +21796,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_t_3 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":232 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":232 * veb.bottom[a] = new_BitSet() * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20726,7 +21805,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":233 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":233 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] * if VEB_insert(subv, b) == 0: # <<<<<<<<<<<<<< @@ -20736,7 +21815,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_t_3 = ((__pyx_f_4cdec_2sa_3_sa_VEB_insert(__pyx_v_subv, __pyx_v_b) == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":234 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":234 * subv = <_VEB*> veb.bottom[a] * if VEB_insert(subv, b) == 0: * return 0 # <<<<<<<<<<<<<< @@ -20745,14 +21824,12 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L9; } - __pyx_L9:; goto __pyx_L8; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":236 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":236 * return 0 * else: * subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20761,7 +21838,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":237 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":237 * else: * subb = <_BitSet*> veb.bottom[a] * if bitset_insert(subb, b) == 0: # <<<<<<<<<<<<<< @@ -20771,7 +21848,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_t_3 = ((__pyx_f_4cdec_2sa_3_sa_bitset_insert(__pyx_v_subb, __pyx_v_b) == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":238 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":238 * subb = <_BitSet*> veb.bottom[a] * if bitset_insert(subb, b) == 0: * return 0 # <<<<<<<<<<<<<< @@ -20780,13 +21857,11 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L10; } - __pyx_L10:; } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":240 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":240 * return 0 * * if i > veb.max_val: # <<<<<<<<<<<<<< @@ -20796,7 +21871,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_t_3 = ((__pyx_v_i > __pyx_v_veb->max_val) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":241 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":241 * * if i > veb.max_val: * veb.max_val = i # <<<<<<<<<<<<<< @@ -20810,7 +21885,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":242 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":242 * if i > veb.max_val: * veb.max_val = i * veb.size = veb.size + 1 # <<<<<<<<<<<<<< @@ -20819,7 +21894,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB */ __pyx_v_veb->size = (__pyx_v_veb->size + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":243 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":243 * veb.max_val = i * veb.size = veb.size + 1 * return 1 # <<<<<<<<<<<<<< @@ -20829,13 +21904,21 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB __pyx_r = 1; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":203 + * + * + * cdef int VEB_insert(_VEB* veb, int i): # <<<<<<<<<<<<<< + * cdef _VEB* subv + * cdef _BitSet* subb + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":246 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":246 * * * cdef del_VEB(_VEB* veb): # <<<<<<<<<<<<<< @@ -20855,7 +21938,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V int __pyx_clineno = 0; __Pyx_RefNannySetupContext("del_VEB", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":249 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":249 * cdef int i * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20865,7 +21948,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V __pyx_t_1 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":250 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":250 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * i = (<_VEB*> veb.top).min_val # <<<<<<<<<<<<<< @@ -20878,7 +21961,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":252 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":252 * i = (<_VEB*> veb.top).min_val * else: * i = (<_BitSet*> veb.top).min_val # <<<<<<<<<<<<<< @@ -20890,7 +21973,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":254 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":254 * i = (<_BitSet*> veb.top).min_val * * while i != -1: # <<<<<<<<<<<<<< @@ -20901,7 +21984,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V __pyx_t_1 = ((__pyx_v_i != -1) != 0); if (!__pyx_t_1) break; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":255 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":255 * * while i != -1: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20911,7 +21994,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V __pyx_t_1 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":256 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":256 * while i != -1: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * del_VEB(<_VEB*> veb.bottom[i]) # <<<<<<<<<<<<<< @@ -20925,7 +22008,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":258 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":258 * del_VEB(<_VEB*> veb.bottom[i]) * else: * free(<_BitSet*> veb.bottom[i]) # <<<<<<<<<<<<<< @@ -20936,7 +22019,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":260 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":260 * free(<_BitSet*> veb.bottom[i]) * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20946,7 +22029,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V __pyx_t_1 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":261 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":261 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * i = VEB_findsucc(<_VEB*> veb.top, i) # <<<<<<<<<<<<<< @@ -20958,7 +22041,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":263 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":263 * i = VEB_findsucc(<_VEB*> veb.top, i) * else: * i = bitset_findsucc(<_BitSet*> veb.top, i) # <<<<<<<<<<<<<< @@ -20970,7 +22053,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V __pyx_L7:; } - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":265 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":265 * i = bitset_findsucc(<_BitSet*> veb.top, i) * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20980,7 +22063,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V __pyx_t_1 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":266 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":266 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * del_VEB(<_VEB*> veb.top) # <<<<<<<<<<<<<< @@ -20994,7 +22077,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":268 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":268 * del_VEB(<_VEB*> veb.top) * else: * free(<_BitSet*> veb.top) # <<<<<<<<<<<<<< @@ -21005,7 +22088,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":269 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":269 * else: * free(<_BitSet*> veb.top) * free(veb.bottom) # <<<<<<<<<<<<<< @@ -21014,7 +22097,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V */ free(__pyx_v_veb->bottom); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":270 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":270 * free(<_BitSet*> veb.top) * free(veb.bottom) * free(veb) # <<<<<<<<<<<<<< @@ -21023,6 +22106,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V */ free(__pyx_v_veb); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":246 + * + * + * cdef del_VEB(_VEB* veb): # <<<<<<<<<<<<<< + * cdef int i + * + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -21035,7 +22127,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":273 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":273 * * * cdef int VEB_findsucc(_VEB* veb, int i): # <<<<<<<<<<<<<< @@ -21058,7 +22150,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE int __pyx_t_3; __Pyx_RefNannySetupContext("VEB_findsucc", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":278 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":278 * cdef int a, b, j, c, found * * if veb.max_val == -1 or i>=veb.max_val: # <<<<<<<<<<<<<< @@ -21074,7 +22166,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":279 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":279 * * if veb.max_val == -1 or i>=veb.max_val: * return -1 # <<<<<<<<<<<<<< @@ -21083,11 +22175,9 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_r = -1; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":280 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":280 * if veb.max_val == -1 or i>=veb.max_val: * return -1 * if i < veb.min_val: # <<<<<<<<<<<<<< @@ -21097,7 +22187,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_3 = ((__pyx_v_i < __pyx_v_veb->min_val) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":281 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":281 * return -1 * if i < veb.min_val: * return veb.min_val # <<<<<<<<<<<<<< @@ -21106,11 +22196,9 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_r = __pyx_v_veb->min_val; goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":283 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":283 * return veb.min_val * * a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<< @@ -21119,7 +22207,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":284 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":284 * * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<< @@ -21128,7 +22216,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_b = (__pyx_v_i & (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":285 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":285 * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] * found = 0 # <<<<<<<<<<<<<< @@ -21137,7 +22225,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_found = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":286 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":286 * b = i & LOWER_MASK[veb.num_bottom_bits-1] * found = 0 * if veb.bottom[a] != NULL: # <<<<<<<<<<<<<< @@ -21147,7 +22235,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_3 = (((__pyx_v_veb->bottom[__pyx_v_a]) != NULL) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":287 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":287 * found = 0 * if veb.bottom[a] != NULL: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -21157,7 +22245,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_3 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":288 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":288 * if veb.bottom[a] != NULL: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -21166,7 +22254,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":289 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":289 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] * if subv.max_val > b: # <<<<<<<<<<<<<< @@ -21176,7 +22264,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_3 = ((__pyx_v_subv->max_val > __pyx_v_b) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":290 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":290 * subv = <_VEB*> veb.bottom[a] * if subv.max_val > b: * j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b) # <<<<<<<<<<<<<< @@ -21185,7 +22273,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(__pyx_v_subv, __pyx_v_b)); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":291 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":291 * if subv.max_val > b: * j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b) * found = 1 # <<<<<<<<<<<<<< @@ -21200,7 +22288,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":293 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":293 * found = 1 * else: * subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -21209,7 +22297,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":294 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":294 * else: * subb = <_BitSet*> veb.bottom[a] * if subb.max_val > b: # <<<<<<<<<<<<<< @@ -21219,7 +22307,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_3 = ((__pyx_v_subb->max_val > __pyx_v_b) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":295 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":295 * subb = <_BitSet*> veb.bottom[a] * if subb.max_val > b: * j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) # <<<<<<<<<<<<<< @@ -21228,7 +22316,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(__pyx_v_subb, __pyx_v_b)); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":296 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":296 * if subb.max_val > b: * j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) * found = 1 # <<<<<<<<<<<<<< @@ -21245,7 +22333,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":297 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":297 * j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) * found = 1 * if found==0: # <<<<<<<<<<<<<< @@ -21255,7 +22343,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_3 = ((__pyx_v_found == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":298 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":298 * found = 1 * if found==0: * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -21265,7 +22353,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_3 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":299 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":299 * if found==0: * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top # <<<<<<<<<<<<<< @@ -21274,7 +22362,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)__pyx_v_veb->top); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":300 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":300 * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top * c = VEB_findsucc(subv, a) # <<<<<<<<<<<<<< @@ -21286,7 +22374,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":302 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":302 * c = VEB_findsucc(subv, a) * else: * subb = <_BitSet*> veb.top # <<<<<<<<<<<<<< @@ -21295,7 +22383,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)__pyx_v_veb->top); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":303 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":303 * else: * subb = <_BitSet*> veb.top * c = bitset_findsucc(subb, a) # <<<<<<<<<<<<<< @@ -21306,7 +22394,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE } __pyx_L10:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":304 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":304 * subb = <_BitSet*> veb.top * c = bitset_findsucc(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -21316,7 +22404,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_3 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":305 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":305 * c = bitset_findsucc(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[c] # <<<<<<<<<<<<<< @@ -21325,7 +22413,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_c])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":306 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":306 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[c] * j = (c << veb.num_bottom_bits) + subv.min_val # <<<<<<<<<<<<<< @@ -21337,7 +22425,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":308 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":308 * j = (c << veb.num_bottom_bits) + subv.min_val * else: * subb = <_BitSet*> veb.bottom[c] # <<<<<<<<<<<<<< @@ -21346,7 +22434,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_c])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":309 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":309 * else: * subb = <_BitSet*> veb.bottom[c] * j = (c << veb.num_bottom_bits) + subb.min_val # <<<<<<<<<<<<<< @@ -21360,7 +22448,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":310 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":310 * subb = <_BitSet*> veb.bottom[c] * j = (c << veb.num_bottom_bits) + subb.min_val * return j # <<<<<<<<<<<<<< @@ -21370,13 +22458,21 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_r = __pyx_v_j; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":273 + * + * + * cdef int VEB_findsucc(_VEB* veb, int i): # <<<<<<<<<<<<<< + * cdef _VEB* subv + * cdef _BitSet* subb + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":313 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":313 * * * cdef int VEB_contains(_VEB* veb, int i): # <<<<<<<<<<<<<< @@ -21397,7 +22493,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE int __pyx_t_4; __Pyx_RefNannySetupContext("VEB_contains", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":318 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":318 * cdef int a, b * * if veb.size == 0 or i < veb.min_val or i > veb.max_val: # <<<<<<<<<<<<<< @@ -21419,7 +22515,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE } if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":319 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":319 * * if veb.size == 0 or i < veb.min_val or i > veb.max_val: * return 0 # <<<<<<<<<<<<<< @@ -21428,11 +22524,9 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":321 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":321 * return 0 * * if veb.min_val == i: # <<<<<<<<<<<<<< @@ -21442,7 +22536,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_2 = ((__pyx_v_veb->min_val == __pyx_v_i) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":322 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":322 * * if veb.min_val == i: * return 1 # <<<<<<<<<<<<<< @@ -21451,11 +22545,10 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L4; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":324 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":324 * return 1 * else: * if veb.size == 1: # <<<<<<<<<<<<<< @@ -21465,7 +22558,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_2 = ((__pyx_v_veb->size == 1) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":325 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":325 * else: * if veb.size == 1: * return 0 # <<<<<<<<<<<<<< @@ -21474,13 +22567,10 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L5; } - __pyx_L5:; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":327 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":327 * return 0 * * a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<< @@ -21489,7 +22579,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":328 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":328 * * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<< @@ -21498,7 +22588,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_b = (__pyx_v_i & (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":329 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":329 * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] * if veb.bottom[a] == NULL: # <<<<<<<<<<<<<< @@ -21508,7 +22598,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_2 = (((__pyx_v_veb->bottom[__pyx_v_a]) == NULL) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":330 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":330 * b = i & LOWER_MASK[veb.num_bottom_bits-1] * if veb.bottom[a] == NULL: * return 0 # <<<<<<<<<<<<<< @@ -21517,11 +22607,10 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L6; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":332 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":332 * return 0 * else: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -21531,7 +22620,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_t_2 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":333 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":333 * else: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -21540,7 +22629,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":334 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":334 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] * return VEB_contains(subv, b) # <<<<<<<<<<<<<< @@ -21549,11 +22638,10 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_r = __pyx_f_4cdec_2sa_3_sa_VEB_contains(__pyx_v_subv, __pyx_v_b); goto __pyx_L0; - goto __pyx_L7; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":336 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":336 * return VEB_contains(subv, b) * else: * subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -21562,7 +22650,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE */ __pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":337 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":337 * else: * subb = <_BitSet*> veb.bottom[a] * return bitset_contains(subb, b) # <<<<<<<<<<<<<< @@ -21572,16 +22660,30 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE __pyx_r = __pyx_f_4cdec_2sa_3_sa_bitset_contains(__pyx_v_subb, __pyx_v_b); goto __pyx_L0; } - __pyx_L7:; } - __pyx_L6:; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":313 + * + * + * cdef int VEB_contains(_VEB* veb, int i): # <<<<<<<<<<<<<< + * cdef _VEB* subv + * cdef _BitSet* subb + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":344 + * cdef int next_val + * + * def __next__(self): # <<<<<<<<<<<<<< + * cdef int ret_val + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11VEBIterator_1__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11VEBIterator_1__next__(PyObject *__pyx_v_self) { @@ -21589,18 +22691,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11VEBIterator_1__next__(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(((struct __pyx_obj_4cdec_2sa_3_sa_VEBIterator *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":344 - * cdef int next_val - * - * def __next__(self): # <<<<<<<<<<<<<< - * cdef int ret_val - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj_4cdec_2sa_3_sa_VEBIterator *__pyx_v_self) { int __pyx_v_ret_val; PyObject *__pyx_r = NULL; @@ -21613,7 +22709,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":347 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":347 * cdef int ret_val * * if self.next_val == -1: # <<<<<<<<<<<<<< @@ -21623,23 +22719,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj __pyx_t_1 = ((__pyx_v_self->next_val == -1) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":348 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":348 * * if self.next_val == -1: * raise StopIteration() # <<<<<<<<<<<<<< * ret_val = self.next_val * self.next_val = VEB_findsucc(self.v, ret_val) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_StopIteration, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[6]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":349 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":349 * if self.next_val == -1: * raise StopIteration() * ret_val = self.next_val # <<<<<<<<<<<<<< @@ -21649,7 +22743,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj __pyx_t_3 = __pyx_v_self->next_val; __pyx_v_ret_val = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":350 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":350 * raise StopIteration() * ret_val = self.next_val * self.next_val = VEB_findsucc(self.v, ret_val) # <<<<<<<<<<<<<< @@ -21658,7 +22752,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj */ __pyx_v_self->next_val = __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(__pyx_v_self->v, __pyx_v_ret_val); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":351 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":351 * ret_val = self.next_val * self.next_val = VEB_findsucc(self.v, ret_val) * return ret_val # <<<<<<<<<<<<<< @@ -21666,14 +22760,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromLong(__pyx_v_ret_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":344 + * cdef int next_val + * + * def __next__(self): # <<<<<<<<<<<<<< + * cdef int ret_val + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.VEBIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -21684,6 +22785,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":360 + * cdef int _first(self) + * + * def __cinit__(self, int size): # <<<<<<<<<<<<<< + * self.veb = new_VEB(size) + * + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -21695,7 +22804,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -21708,7 +22817,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObj kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size)) != 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)) { @@ -21719,7 +22828,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObj } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } - __pyx_v_size = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_size = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; @@ -21730,24 +22839,18 @@ static int __pyx_pw_4cdec_2sa_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObj return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_3VEB___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_v_self), __pyx_v_size); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":360 - * cdef int _first(self) - * - * def __cinit__(self, int size): # <<<<<<<<<<<<<< - * self.veb = new_VEB(size) - * - */ - static int __pyx_pf_4cdec_2sa_3_sa_3VEB___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_VEB *__pyx_v_self, int __pyx_v_size) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":361 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":361 * * def __cinit__(self, int size): * self.veb = new_VEB(size) # <<<<<<<<<<<<<< @@ -21756,28 +22859,39 @@ static int __pyx_pf_4cdec_2sa_3_sa_3VEB___cinit__(struct __pyx_obj_4cdec_2sa_3_s */ __pyx_v_self->veb = __pyx_f_4cdec_2sa_3_sa_new_VEB(__pyx_v_size); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":360 + * cdef int _first(self) + * + * def __cinit__(self, int size): # <<<<<<<<<<<<<< + * self.veb = new_VEB(size) + * + */ + + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":363 + * self.veb = new_VEB(size) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del_VEB(self.veb) + * + */ + /* Python wrapper */ static void __pyx_pw_4cdec_2sa_3_sa_3VEB_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4cdec_2sa_3_sa_3VEB_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_4cdec_2sa_3_sa_3VEB_2__dealloc__(((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":363 - * self.veb = new_VEB(size) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * del_VEB(self.veb) - * - */ - static void __pyx_pf_4cdec_2sa_3_sa_3VEB_2__dealloc__(struct __pyx_obj_4cdec_2sa_3_sa_VEB *__pyx_v_self) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -21786,7 +22900,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_3VEB_2__dealloc__(struct __pyx_obj_4cdec_2sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":364 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":364 * * def __dealloc__(self): * del_VEB(self.veb) # <<<<<<<<<<<<<< @@ -21797,14 +22911,31 @@ static void __pyx_pf_4cdec_2sa_3_sa_3VEB_2__dealloc__(struct __pyx_obj_4cdec_2sa __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":363 + * self.veb = new_VEB(size) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * del_VEB(self.veb) + * + */ + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cdec.sa._sa.VEB.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.VEB.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":366 + * del_VEB(self.veb) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef VEBIterator it + * it = VEBIterator() + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3VEB_5__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3VEB_5__iter__(PyObject *__pyx_v_self) { @@ -21812,18 +22943,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3VEB_5__iter__(PyObject *__pyx_v_self) __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":366 - * del_VEB(self.veb) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * cdef VEBIterator it - * it = VEBIterator() - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2sa_3_sa_VEB *__pyx_v_self) { struct __pyx_obj_4cdec_2sa_3_sa_VEBIterator *__pyx_v_it = 0; PyObject *__pyx_r = NULL; @@ -21836,19 +22961,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":368 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":368 * def __iter__(self): * cdef VEBIterator it * it = VEBIterator() # <<<<<<<<<<<<<< * it.v = self.veb * it.next_val = self.veb.min_val */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_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_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_VEBIterator)), __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_4cdec_2sa_3_sa_VEBIterator *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":369 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":369 * cdef VEBIterator it * it = VEBIterator() * it.v = self.veb # <<<<<<<<<<<<<< @@ -21858,7 +22983,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2 __pyx_t_2 = __pyx_v_self->veb; __pyx_v_it->v = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":370 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":370 * it = VEBIterator() * it.v = self.veb * it.next_val = self.veb.min_val # <<<<<<<<<<<<<< @@ -21868,7 +22993,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2 __pyx_t_3 = __pyx_v_self->veb->min_val; __pyx_v_it->next_val = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":371 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":371 * it.v = self.veb * it.next_val = self.veb.min_val * return it # <<<<<<<<<<<<<< @@ -21880,8 +23005,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2 __pyx_r = ((PyObject *)__pyx_v_it); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":366 + * del_VEB(self.veb) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef VEBIterator it + * it = VEBIterator() + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.VEB.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -21893,6 +23025,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2 return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":373 + * return it + * + * def insert(self, i): # <<<<<<<<<<<<<< + * return VEB_insert(self.veb, i) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3VEB_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3VEB_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -21900,18 +23040,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3VEB_7insert(PyObject *__pyx_v_self, Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insert (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_3VEB_6insert(((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":373 - * return it - * - * def insert(self, i): # <<<<<<<<<<<<<< - * return VEB_insert(self.veb, i) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_6insert(struct __pyx_obj_4cdec_2sa_3_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -21922,7 +23056,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_6insert(struct __pyx_obj_4cdec_2sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insert", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":374 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":374 * * def insert(self, i): * return VEB_insert(self.veb, i) # <<<<<<<<<<<<<< @@ -21930,15 +23064,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_6insert(struct __pyx_obj_4cdec_2sa * cdef int _insert(self, int i): */ __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_4cdec_2sa_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_t_1 = __Pyx_PyInt_As_int(__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 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_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; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":373 + * return it + * + * def insert(self, i): # <<<<<<<<<<<<<< + * return VEB_insert(self.veb, i) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.VEB.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -21949,7 +23090,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_6insert(struct __pyx_obj_4cdec_2sa return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":376 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":376 * return VEB_insert(self.veb, i) * * cdef int _insert(self, int i): # <<<<<<<<<<<<<< @@ -21962,7 +23103,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__insert(struct __pyx_obj_4cdec_2sa_3_sa_V __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_insert", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":377 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":377 * * cdef int _insert(self, int i): * return VEB_insert(self.veb, i) # <<<<<<<<<<<<<< @@ -21972,12 +23113,28 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__insert(struct __pyx_obj_4cdec_2sa_3_sa_V __pyx_r = __pyx_f_4cdec_2sa_3_sa_VEB_insert(__pyx_v_self->veb, __pyx_v_i); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":376 + * return VEB_insert(self.veb, i) + * + * cdef int _insert(self, int i): # <<<<<<<<<<<<<< + * return VEB_insert(self.veb, i) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":379 + * return VEB_insert(self.veb, i) + * + * def findsucc(self, i): # <<<<<<<<<<<<<< + * return VEB_findsucc(self.veb, i) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3VEB_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3VEB_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -21985,18 +23142,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3VEB_9findsucc(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("findsucc (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_3VEB_8findsucc(((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":379 - * return VEB_insert(self.veb, i) - * - * def findsucc(self, i): # <<<<<<<<<<<<<< - * return VEB_findsucc(self.veb, i) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_8findsucc(struct __pyx_obj_4cdec_2sa_3_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -22007,7 +23158,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_8findsucc(struct __pyx_obj_4cdec_2 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("findsucc", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":380 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":380 * * def findsucc(self, i): * return VEB_findsucc(self.veb, i) # <<<<<<<<<<<<<< @@ -22015,15 +23166,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_8findsucc(struct __pyx_obj_4cdec_2 * cdef int _first(self): */ __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_4cdec_2sa_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_t_1 = __Pyx_PyInt_As_int(__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 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_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; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":379 + * return VEB_insert(self.veb, i) + * + * def findsucc(self, i): # <<<<<<<<<<<<<< + * return VEB_findsucc(self.veb, i) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.VEB.findsucc", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -22034,7 +23192,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_8findsucc(struct __pyx_obj_4cdec_2 return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":382 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":382 * return VEB_findsucc(self.veb, i) * * cdef int _first(self): # <<<<<<<<<<<<<< @@ -22047,7 +23205,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__first(struct __pyx_obj_4cdec_2sa_3_sa_VE __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_first", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":383 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":383 * * cdef int _first(self): * return self.veb.min_val # <<<<<<<<<<<<<< @@ -22057,13 +23215,21 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__first(struct __pyx_obj_4cdec_2sa_3_sa_VE __pyx_r = __pyx_v_self->veb->min_val; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":382 + * return VEB_findsucc(self.veb, i) + * + * cdef int _first(self): # <<<<<<<<<<<<<< + * return self.veb.min_val + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":385 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":385 * return self.veb.min_val * * cdef int _findsucc(self, int i): # <<<<<<<<<<<<<< @@ -22076,7 +23242,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__findsucc(struct __pyx_obj_4cdec_2sa_3_sa __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_findsucc", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":386 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":386 * * cdef int _findsucc(self, int i): * return VEB_findsucc(self.veb, i) # <<<<<<<<<<<<<< @@ -22086,12 +23252,28 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__findsucc(struct __pyx_obj_4cdec_2sa_3_sa __pyx_r = __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(__pyx_v_self->veb, __pyx_v_i); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":385 + * return self.veb.min_val + * + * cdef int _findsucc(self, int i): # <<<<<<<<<<<<<< + * return VEB_findsucc(self.veb, i) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":388 + * return VEB_findsucc(self.veb, i) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.veb.size + * + */ + /* Python wrapper */ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_3VEB_11__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_3VEB_11__len__(PyObject *__pyx_v_self) { @@ -22099,24 +23281,18 @@ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_3VEB_11__len__(PyObject *__pyx_v_self) __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_3VEB_10__len__(((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":388 - * return VEB_findsucc(self.veb, i) - * - * def __len__(self): # <<<<<<<<<<<<<< - * return self.veb.size - * - */ - static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_3VEB_10__len__(struct __pyx_obj_4cdec_2sa_3_sa_VEB *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":389 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":389 * * def __len__(self): * return self.veb.size # <<<<<<<<<<<<<< @@ -22126,12 +23302,27 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_3VEB_10__len__(struct __pyx_obj_4cdec_ __pyx_r = __pyx_v_self->veb->size; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":388 + * return VEB_findsucc(self.veb, i) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.veb.size + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":391 + * return self.veb.size + * + * def __contains__(self, i): # <<<<<<<<<<<<<< + * return VEB_contains(self.veb, i) + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_3VEB_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_3VEB_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -22139,17 +23330,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_3VEB_13__contains__(PyObject *__pyx_v_self, P __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_3VEB_12__contains__(((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":391 - * return self.veb.size - * - * def __contains__(self, i): # <<<<<<<<<<<<<< - * return VEB_contains(self.veb, i) - */ - static int __pyx_pf_4cdec_2sa_3_sa_3VEB_12__contains__(struct __pyx_obj_4cdec_2sa_3_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i) { int __pyx_r; __Pyx_RefNannyDeclarations @@ -22159,17 +23345,23 @@ static int __pyx_pf_4cdec_2sa_3_sa_3VEB_12__contains__(struct __pyx_obj_4cdec_2s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":392 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":392 * * def __contains__(self, i): * 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_t_1 = __Pyx_PyInt_As_int(__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_4cdec_2sa_3_sa_VEB_contains(__pyx_v_self->veb, __pyx_t_1); goto __pyx_L0; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":391 + * return self.veb.size + * + * def __contains__(self, i): # <<<<<<<<<<<<<< + * return VEB_contains(self.veb, i) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("cdec.sa._sa.VEB.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; @@ -22178,6 +23370,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_3VEB_12__contains__(struct __pyx_obj_4cdec_2s return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":9 + * cdef IntList lcp + * + * def __cinit__(self, SuffixArray sa): # <<<<<<<<<<<<<< + * cdef int i, k, j, h, n + * cdef IntList rank + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -22189,7 +23389,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sa,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -22202,7 +23402,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObj kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sa)) != 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)) { @@ -22225,6 +23425,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObj __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sa), __pyx_ptype_4cdec_2sa_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_4cdec_2sa_3_sa_3LCP___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_LCP *)__pyx_v_self), __pyx_v_sa); + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; @@ -22233,14 +23435,6 @@ static int __pyx_pw_4cdec_2sa_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":9 - * cdef IntList lcp - * - * def __cinit__(self, SuffixArray sa): # <<<<<<<<<<<<<< - * cdef int i, k, j, h, n - * cdef IntList rank - */ - static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_LCP *__pyx_v_self, struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_sa) { int __pyx_v_i; int __pyx_v_k; @@ -22262,24 +23456,24 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":13 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":13 * cdef IntList rank * * logger.info("Constructing LCP array") # <<<<<<<<<<<<<< * self.sa = sa * n = self.sa.sa.len */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_63), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 13; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":14 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":14 * * logger.info("Constructing LCP array") * self.sa = sa # <<<<<<<<<<<<<< @@ -22292,7 +23486,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s __Pyx_DECREF(((PyObject *)__pyx_v_self->sa)); __pyx_v_self->sa = __pyx_v_sa; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":15 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":15 * logger.info("Constructing LCP array") * self.sa = sa * n = self.sa.sa.len # <<<<<<<<<<<<<< @@ -22302,7 +23496,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s __pyx_t_3 = __pyx_v_self->sa->sa->len; __pyx_v_n = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":16 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":16 * self.sa = sa * n = self.sa.sa.len * self.lcp = IntList(initial_len=n) # <<<<<<<<<<<<<< @@ -22310,21 +23504,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s * rank = IntList(initial_len=n) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); 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); - 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;} + if (PyDict_SetItem(__pyx_t_1, __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_4cdec_2sa_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_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __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_DECREF(__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_4cdec_2sa_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":18 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":18 * self.lcp = IntList(initial_len=n) * * rank = IntList(initial_len=n) # <<<<<<<<<<<<<< @@ -22332,18 +23526,18 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s * rank.arr[sa.sa.arr[i]] = i */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 18; __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[9]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n); 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); - 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;} + if (PyDict_SetItem(__pyx_t_2, __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_4cdec_2sa_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_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rank = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":19 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":19 * * rank = IntList(initial_len=n) * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -22353,7 +23547,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":20 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":20 * rank = IntList(initial_len=n) * for i from 0 <= i < n: * rank.arr[sa.sa.arr[i]] = i # <<<<<<<<<<<<<< @@ -22363,7 +23557,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s (__pyx_v_rank->arr[(__pyx_v_sa->sa->arr[__pyx_v_i])]) = __pyx_v_i; } - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":22 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":22 * rank.arr[sa.sa.arr[i]] = i * * h = 0 # <<<<<<<<<<<<<< @@ -22372,7 +23566,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s */ __pyx_v_h = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":23 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":23 * * h = 0 * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -22382,7 +23576,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":24 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":24 * h = 0 * for i from 0 <= i < n: * k = rank.arr[i] # <<<<<<<<<<<<<< @@ -22391,7 +23585,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s */ __pyx_v_k = (__pyx_v_rank->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":25 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":25 * for i from 0 <= i < n: * k = rank.arr[i] * if k == 0: # <<<<<<<<<<<<<< @@ -22401,7 +23595,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s __pyx_t_4 = ((__pyx_v_k == 0) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":26 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":26 * k = rank.arr[i] * if k == 0: * self.lcp.arr[k] = -1 # <<<<<<<<<<<<<< @@ -22413,7 +23607,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":28 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":28 * self.lcp.arr[k] = -1 * else: * j = sa.sa.arr[k-1] # <<<<<<<<<<<<<< @@ -22422,7 +23616,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s */ __pyx_v_j = (__pyx_v_sa->sa->arr[(__pyx_v_k - 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":29 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":29 * else: * j = sa.sa.arr[k-1] * while i+h < n and j+h < n and sa.darray.data.arr[i+h] == sa.darray.data.arr[j+h]: # <<<<<<<<<<<<<< @@ -22445,7 +23639,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s } if (!__pyx_t_5) break; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":30 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":30 * j = sa.sa.arr[k-1] * while i+h < n and j+h < n and sa.darray.data.arr[i+h] == sa.darray.data.arr[j+h]: * h = h+1 # <<<<<<<<<<<<<< @@ -22455,7 +23649,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s __pyx_v_h = (__pyx_v_h + 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":31 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":31 * while i+h < n and j+h < n and sa.darray.data.arr[i+h] == sa.darray.data.arr[j+h]: * h = h+1 * self.lcp.arr[k] = h # <<<<<<<<<<<<<< @@ -22466,7 +23660,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":32 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":32 * h = h+1 * self.lcp.arr[k] = h * if h > 0: # <<<<<<<<<<<<<< @@ -22476,7 +23670,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s __pyx_t_5 = ((__pyx_v_h > 0) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":33 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":33 * self.lcp.arr[k] = h * if h > 0: * h = h-1 # <<<<<<<<<<<<<< @@ -22489,23 +23683,32 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s __pyx_L10:; } - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":34 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":34 * if h > 0: * h = h-1 * logger.info("LCP array completed") # <<<<<<<<<<<<<< * * def compute_stats(self, int max_n): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_65), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 34; __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; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":9 + * cdef IntList lcp + * + * def __cinit__(self, SuffixArray sa): # <<<<<<<<<<<<<< + * cdef int i, k, j, h, n + * cdef IntList rank + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -22520,6 +23723,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s } static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":36 + * logger.info("LCP array completed") + * + * def compute_stats(self, int max_n): # <<<<<<<<<<<<<< + * """Note: the output of this function is not exact. In + * particular, the frequency associated with each word is + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3LCP_3compute_stats(PyObject *__pyx_v_self, PyObject *__pyx_arg_max_n); /*proto*/ static char __pyx_doc_4cdec_2sa_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"; @@ -22532,7 +23743,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3LCP_3compute_stats(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compute_stats (wrapper)", 0); assert(__pyx_arg_max_n); { - __pyx_v_max_n = __Pyx_PyInt_AsInt(__pyx_arg_max_n); if (unlikely((__pyx_v_max_n == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_n = __Pyx_PyInt_As_int(__pyx_arg_max_n); if (unlikely((__pyx_v_max_n == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22541,18 +23752,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_3LCP_3compute_stats(PyObject *__pyx_v_s return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_3LCP_2compute_stats(((struct __pyx_obj_4cdec_2sa_3_sa_LCP *)__pyx_v_self), ((int)__pyx_v_max_n)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":36 - * logger.info("LCP array completed") - * - * def compute_stats(self, int max_n): # <<<<<<<<<<<<<< - * """Note: the output of this function is not exact. In - * particular, the frequency associated with each word is - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_3LCP_2compute_stats(struct __pyx_obj_4cdec_2sa_3_sa_LCP *__pyx_v_self, int __pyx_v_max_n) { struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *__pyx_cur_scope; PyObject *__pyx_r = NULL; @@ -22578,6 +23783,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3LCP_2compute_stats(struct __pyx_obj_4c return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -22619,7 +23825,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":48 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":48 * cdef VEB veb * * N = self.sa.sa.len # <<<<<<<<<<<<<< @@ -22629,7 +23835,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_1 = __pyx_cur_scope->__pyx_v_self->sa->sa->len; __pyx_cur_scope->__pyx_v_N = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":50 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":50 * N = self.sa.sa.len * * ngram_starts = [] # <<<<<<<<<<<<<< @@ -22638,11 +23844,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_ngram_starts = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":51 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":51 * * ngram_starts = [] * for n from 0 <= n < max_n: # <<<<<<<<<<<<<< @@ -22652,7 +23858,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_1 = __pyx_cur_scope->__pyx_v_max_n; for (__pyx_cur_scope->__pyx_v_n = 0; __pyx_cur_scope->__pyx_v_n < __pyx_t_1; __pyx_cur_scope->__pyx_v_n++) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":52 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":52 * ngram_starts = [] * for n from 0 <= n < max_n: * ngram_starts.append(IntList(initial_len=N)) # <<<<<<<<<<<<<< @@ -22660,19 +23866,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject * run_start = IntList(initial_len=max_n) */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_N); 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); - if (PyDict_SetItem(__pyx_t_2, ((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;} + if (PyDict_SetItem(__pyx_t_2, __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_2); 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_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_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;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":54 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":54 * ngram_starts.append(IntList(initial_len=N)) * * run_start = IntList(initial_len=max_n) # <<<<<<<<<<<<<< @@ -22680,40 +23886,40 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject * */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_max_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_max_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_initial_len, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 54; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 54; __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_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_run_start = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":55 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":55 * * run_start = IntList(initial_len=max_n) * veb = VEB(N) # <<<<<<<<<<<<<< * * for i from 0 <= i < N: */ - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 55; __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[9]; __pyx_lineno = 55; __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(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_VEB)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_VEB)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 55; __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_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_veb = ((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":57 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":57 * veb = VEB(N) * * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -22723,7 +23929,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_1 = __pyx_cur_scope->__pyx_v_N; for (__pyx_cur_scope->__pyx_v_i = 0; __pyx_cur_scope->__pyx_v_i < __pyx_t_1; __pyx_cur_scope->__pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":58 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":58 * * for i from 0 <= i < N: * h = self.lcp.arr[i] # <<<<<<<<<<<<<< @@ -22732,7 +23938,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ __pyx_cur_scope->__pyx_v_h = (__pyx_cur_scope->__pyx_v_self->lcp->arr[__pyx_cur_scope->__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":59 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":59 * for i from 0 <= i < N: * h = self.lcp.arr[i] * if h < 0: # <<<<<<<<<<<<<< @@ -22742,7 +23948,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_5 = ((__pyx_cur_scope->__pyx_v_h < 0) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":60 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":60 * h = self.lcp.arr[i] * if h < 0: * h = 0 # <<<<<<<<<<<<<< @@ -22754,7 +23960,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":61 * if h < 0: * h = 0 * for n from h <= n < max_n: # <<<<<<<<<<<<<< @@ -22764,7 +23970,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_6 = __pyx_cur_scope->__pyx_v_max_n; for (__pyx_cur_scope->__pyx_v_n = __pyx_cur_scope->__pyx_v_h; __pyx_cur_scope->__pyx_v_n < __pyx_t_6; __pyx_cur_scope->__pyx_v_n++) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":62 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":62 * h = 0 * for n from h <= n < max_n: * rs = run_start.arr[n] # <<<<<<<<<<<<<< @@ -22773,7 +23979,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ __pyx_cur_scope->__pyx_v_rs = (__pyx_cur_scope->__pyx_v_run_start->arr[__pyx_cur_scope->__pyx_v_n]); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":63 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":63 * for n from h <= n < max_n: * rs = run_start.arr[n] * run_start.arr[n] = i # <<<<<<<<<<<<<< @@ -22782,7 +23988,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ (__pyx_cur_scope->__pyx_v_run_start->arr[__pyx_cur_scope->__pyx_v_n]) = __pyx_cur_scope->__pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":64 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":64 * rs = run_start.arr[n] * run_start.arr[n] = i * freq = i - rs # <<<<<<<<<<<<<< @@ -22791,7 +23997,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ __pyx_cur_scope->__pyx_v_freq = (__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_rs); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":65 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":65 * run_start.arr[n] = i * freq = i - rs * if freq > 1000: # arbitrary, but see note below # <<<<<<<<<<<<<< @@ -22801,7 +24007,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_5 = ((__pyx_cur_scope->__pyx_v_freq > 1000) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":66 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":66 * freq = i - rs * if freq > 1000: # arbitrary, but see note below * veb._insert(freq) # <<<<<<<<<<<<<< @@ -22810,14 +24016,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_insert(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_freq); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":67 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":67 * if freq > 1000: # arbitrary, but see note below * veb._insert(freq) * ngram_start = ngram_starts[n] # <<<<<<<<<<<<<< * while ngram_start.arr[freq] > 0: * freq = freq + 1 # cheating a bit, should be ok for sparse histogram */ - __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_cur_scope->__pyx_v_ngram_starts), __pyx_cur_scope->__pyx_v_n, sizeof(int), PyInt_FromLong, 1, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v_ngram_starts, __pyx_cur_scope->__pyx_v_n, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 67; __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_4cdec_2sa_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)); @@ -22825,7 +24031,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":68 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":68 * veb._insert(freq) * ngram_start = ngram_starts[n] * while ngram_start.arr[freq] > 0: # <<<<<<<<<<<<<< @@ -22836,7 +24042,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_5 = (((__pyx_cur_scope->__pyx_v_ngram_start->arr[__pyx_cur_scope->__pyx_v_freq]) > 0) != 0); if (!__pyx_t_5) break; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":69 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":69 * ngram_start = ngram_starts[n] * while ngram_start.arr[freq] > 0: * freq = freq + 1 # cheating a bit, should be ok for sparse histogram # <<<<<<<<<<<<<< @@ -22846,7 +24052,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_cur_scope->__pyx_v_freq = (__pyx_cur_scope->__pyx_v_freq + 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":70 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":70 * while ngram_start.arr[freq] > 0: * freq = freq + 1 # cheating a bit, should be ok for sparse histogram * ngram_start.arr[freq] = rs # <<<<<<<<<<<<<< @@ -22860,7 +24066,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject } } - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":71 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":71 * freq = freq + 1 # cheating a bit, should be ok for sparse histogram * ngram_start.arr[freq] = rs * i = veb.veb.min_val # <<<<<<<<<<<<<< @@ -22870,7 +24076,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_1 = __pyx_cur_scope->__pyx_v_veb->veb->min_val; __pyx_cur_scope->__pyx_v_i = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":72 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":72 * ngram_start.arr[freq] = rs * i = veb.veb.min_val * while i != -1: # <<<<<<<<<<<<<< @@ -22881,7 +24087,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_5 = ((__pyx_cur_scope->__pyx_v_i != -1) != 0); if (!__pyx_t_5) break; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":73 * i = veb.veb.min_val * while i != -1: * ii = veb._findsucc(i) # <<<<<<<<<<<<<< @@ -22890,7 +24096,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ __pyx_cur_scope->__pyx_v_ii = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_findsucc(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_i); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":74 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":74 * while i != -1: * ii = veb._findsucc(i) * for n from 0 <= n < max_n: # <<<<<<<<<<<<<< @@ -22900,14 +24106,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_1 = __pyx_cur_scope->__pyx_v_max_n; for (__pyx_cur_scope->__pyx_v_n = 0; __pyx_cur_scope->__pyx_v_n < __pyx_t_1; __pyx_cur_scope->__pyx_v_n++) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":75 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":75 * ii = veb._findsucc(i) * for n from 0 <= n < max_n: * ngram_start = ngram_starts[n] # <<<<<<<<<<<<<< * iii = i * rs = ngram_start.arr[iii] */ - __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_cur_scope->__pyx_v_ngram_starts), __pyx_cur_scope->__pyx_v_n, sizeof(int), PyInt_FromLong, 1, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v_ngram_starts, __pyx_cur_scope->__pyx_v_n, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 75; __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_4cdec_2sa_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)); @@ -22915,7 +24121,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":76 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":76 * for n from 0 <= n < max_n: * ngram_start = ngram_starts[n] * iii = i # <<<<<<<<<<<<<< @@ -22924,7 +24130,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ __pyx_cur_scope->__pyx_v_iii = __pyx_cur_scope->__pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":77 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":77 * ngram_start = ngram_starts[n] * iii = i * rs = ngram_start.arr[iii] # <<<<<<<<<<<<<< @@ -22933,7 +24139,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ __pyx_cur_scope->__pyx_v_rs = (__pyx_cur_scope->__pyx_v_ngram_start->arr[__pyx_cur_scope->__pyx_v_iii]); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":78 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":78 * iii = i * rs = ngram_start.arr[iii] * while (ii==-1 or iii < ii) and rs != 0: # <<<<<<<<<<<<<< @@ -22956,7 +24162,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject } if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":79 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":79 * rs = ngram_start.arr[iii] * while (ii==-1 or iii < ii) and rs != 0: * j = self.sa.sa.arr[rs] # <<<<<<<<<<<<<< @@ -22965,7 +24171,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ __pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_self->sa->sa->arr[__pyx_cur_scope->__pyx_v_rs]); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":80 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":80 * while (ii==-1 or iii < ii) and rs != 0: * j = self.sa.sa.arr[rs] * valid = 1 # <<<<<<<<<<<<<< @@ -22974,7 +24180,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ __pyx_cur_scope->__pyx_v_valid = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":81 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":81 * j = self.sa.sa.arr[rs] * valid = 1 * for k from 0 <= k < n+1: # <<<<<<<<<<<<<< @@ -22984,7 +24190,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_9 = (__pyx_cur_scope->__pyx_v_n + 1); for (__pyx_cur_scope->__pyx_v_k = 0; __pyx_cur_scope->__pyx_v_k < __pyx_t_9; __pyx_cur_scope->__pyx_v_k++) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":82 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":82 * valid = 1 * for k from 0 <= k < n+1: * if self.sa.darray.data.arr[j+k] < 2: # <<<<<<<<<<<<<< @@ -22994,7 +24200,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_7 = (((__pyx_cur_scope->__pyx_v_self->sa->darray->data->arr[(__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_k)]) < 2) != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":83 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":83 * for k from 0 <= k < n+1: * if self.sa.darray.data.arr[j+k] < 2: * valid = 0 # <<<<<<<<<<<<<< @@ -23007,7 +24213,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_L22:; } - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":84 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":84 * if self.sa.darray.data.arr[j+k] < 2: * valid = 0 * if valid: # <<<<<<<<<<<<<< @@ -23017,7 +24223,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_7 = (__pyx_cur_scope->__pyx_v_valid != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":85 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":85 * valid = 0 * if valid: * ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)]) # <<<<<<<<<<<<<< @@ -23029,29 +24235,29 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __pyx_t_9 = (__pyx_cur_scope->__pyx_v_n + 1); for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_9; __pyx_t_6+=1) { __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_t_3 = __Pyx_PyInt_From_int((__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(__Pyx_ListComp_Append(__pyx_t_2, (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(((PyObject*)__pyx_t_2))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ngram)); + __pyx_t_3 = PyList_AsTuple(((PyObject*)__pyx_t_2)); 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); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ngram); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ngram, ((PyObject*)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":86 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":86 * if valid: * ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)]) * yield i, n+1, ngram # <<<<<<<<<<<<<< * iii = iii + 1 * rs = ngram_start.arr[iii] */ - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_n + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_cur_scope->__pyx_v_n + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); @@ -23059,12 +24265,12 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_ngram)); - PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_cur_scope->__pyx_v_ngram)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_ngram)); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ngram); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_v_ngram); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ngram); __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_r = ((PyObject *)__pyx_t_10); + __pyx_r = __pyx_t_10; __pyx_t_10 = 0; __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __Pyx_XGIVEREF(__pyx_r); @@ -23079,7 +24285,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject } __pyx_L23:; - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":87 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":87 * ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)]) * yield i, n+1, ngram * iii = iii + 1 # <<<<<<<<<<<<<< @@ -23088,7 +24294,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject */ __pyx_cur_scope->__pyx_v_iii = (__pyx_cur_scope->__pyx_v_iii + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":88 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":88 * yield i, n+1, ngram * iii = iii + 1 * rs = ngram_start.arr[iii] # <<<<<<<<<<<<<< @@ -23098,13 +24304,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject } } - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":89 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":89 * iii = iii + 1 * rs = ngram_start.arr[iii] * i = ii # <<<<<<<<<<<<<< */ __pyx_cur_scope->__pyx_v_i = __pyx_cur_scope->__pyx_v_ii; } + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":36 + * logger.info("LCP array completed") + * + * def compute_stats(self, int max_n): # <<<<<<<<<<<<<< + * """Note: the output of this function is not exact. In + * particular, the frequency associated with each word is + */ + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -23120,6 +24336,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject return NULL; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":12 + * cdef dict id2sym + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.terminals = StringMap() + * self.nonterminals = StringMap() + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -23130,18 +24354,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, __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_4cdec_2sa_3_sa_8Alphabet___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":12 - * cdef dict id2sym - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.terminals = StringMap() - * self.nonterminals = StringMap() - */ - static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations @@ -23151,14 +24369,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":13 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":13 * * def __cinit__(self): * self.terminals = StringMap() # <<<<<<<<<<<<<< * self.nonterminals = StringMap() * self.id2sym = {} */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_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_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_StringMap)), __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); @@ -23166,14 +24384,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s __pyx_v_self->terminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":14 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":14 * def __cinit__(self): * self.terminals = StringMap() * self.nonterminals = StringMap() # <<<<<<<<<<<<<< * self.id2sym = {} * self.first_nonterminal = -1 */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_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_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_StringMap)), __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); @@ -23181,7 +24399,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s __pyx_v_self->nonterminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":15 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":15 * self.terminals = StringMap() * self.nonterminals = StringMap() * self.id2sym = {} # <<<<<<<<<<<<<< @@ -23189,14 +24407,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s * */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->id2sym); - __Pyx_DECREF(((PyObject *)__pyx_v_self->id2sym)); + __Pyx_DECREF(__pyx_v_self->id2sym); __pyx_v_self->id2sym = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":16 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":16 * self.nonterminals = StringMap() * self.id2sym = {} * self.first_nonterminal = -1 # <<<<<<<<<<<<<< @@ -23205,6 +24423,15 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s */ __pyx_v_self->first_nonterminal = -1; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":12 + * cdef dict id2sym + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.terminals = StringMap() + * self.nonterminals = StringMap() + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -23216,31 +24443,34 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":18 + * self.first_nonterminal = -1 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * pass + * + */ + /* Python wrapper */ static void __pyx_pw_4cdec_2sa_3_sa_8Alphabet_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4cdec_2sa_3_sa_8Alphabet_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_4cdec_2sa_3_sa_8Alphabet_2__dealloc__(((struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":18 - * self.first_nonterminal = -1 - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * pass - * - */ - static void __pyx_pf_4cdec_2sa_3_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":21 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":21 * pass * * cdef int isvar(self, int sym): # <<<<<<<<<<<<<< @@ -23253,7 +24483,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isvar", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":22 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":22 * * cdef int isvar(self, int sym): * return sym < 0 # <<<<<<<<<<<<<< @@ -23263,13 +24493,21 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj __pyx_r = (__pyx_v_sym < 0); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":21 + * pass + * + * cdef int isvar(self, int sym): # <<<<<<<<<<<<<< + * return sym < 0 + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":24 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":24 * return sym < 0 * * cdef int isword(self, int sym): # <<<<<<<<<<<<<< @@ -23282,7 +24520,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isword", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":25 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":25 * * cdef int isword(self, int sym): * return sym >= 0 # <<<<<<<<<<<<<< @@ -23292,13 +24530,21 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_ob __pyx_r = (__pyx_v_sym >= 0); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":24 + * return sym < 0 + * + * cdef int isword(self, int sym): # <<<<<<<<<<<<<< + * return sym >= 0 + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":27 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":27 * return sym >= 0 * * cdef int getindex(self, int sym): # <<<<<<<<<<<<<< @@ -23311,7 +24557,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getindex", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":28 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":28 * * cdef int getindex(self, int sym): * return -sym & INDEX_MASK # <<<<<<<<<<<<<< @@ -23321,13 +24567,21 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_ __pyx_r = ((-__pyx_v_sym) & __pyx_v_4cdec_2sa_3_sa_INDEX_MASK); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":27 + * return sym >= 0 + * + * cdef int getindex(self, int sym): # <<<<<<<<<<<<<< + * return -sym & INDEX_MASK + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":30 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":30 * return -sym & INDEX_MASK * * cdef int setindex(self, int sym, int ind): # <<<<<<<<<<<<<< @@ -23340,7 +24594,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setindex", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":31 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":31 * * cdef int setindex(self, int sym, int ind): * return -(-sym & ~INDEX_MASK | ind) # <<<<<<<<<<<<<< @@ -23350,13 +24604,21 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_ __pyx_r = (-(((-__pyx_v_sym) & (~__pyx_v_4cdec_2sa_3_sa_INDEX_MASK)) | __pyx_v_ind)); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":30 + * return -sym & INDEX_MASK + * + * cdef int setindex(self, int sym, int ind): # <<<<<<<<<<<<<< + * return -(-sym & ~INDEX_MASK | ind) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":33 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":33 * return -(-sym & ~INDEX_MASK | ind) * * cdef int clearindex(self, int sym): # <<<<<<<<<<<<<< @@ -23369,7 +24631,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearindex", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":34 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":34 * * cdef int clearindex(self, int sym): * return -(-sym& ~INDEX_MASK) # <<<<<<<<<<<<<< @@ -23379,13 +24641,21 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __py __pyx_r = (-((-__pyx_v_sym) & (~__pyx_v_4cdec_2sa_3_sa_INDEX_MASK))); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":33 + * return -(-sym & ~INDEX_MASK | ind) + * + * cdef int clearindex(self, int sym): # <<<<<<<<<<<<<< + * return -(-sym& ~INDEX_MASK) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":36 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":36 * return -(-sym& ~INDEX_MASK) * * cdef int match(self, int sym1, int sym2): # <<<<<<<<<<<<<< @@ -23398,7 +24668,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_match(struct __pyx_obj_4cdec_2sa_3_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("match", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":37 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":37 * * cdef int match(self, int sym1, int sym2): * return self.clearindex(sym1) == self.clearindex(sym2); # <<<<<<<<<<<<<< @@ -23408,13 +24678,21 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_match(struct __pyx_obj_4cdec_2sa_3_s __pyx_r = (((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->clearindex(__pyx_v_self, __pyx_v_sym1) == ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->clearindex(__pyx_v_self, __pyx_v_sym2)); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":36 + * return -(-sym& ~INDEX_MASK) + * + * cdef int match(self, int sym1, int sym2): # <<<<<<<<<<<<<< + * return self.clearindex(sym1) == self.clearindex(sym2); + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":39 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":39 * return self.clearindex(sym1) == self.clearindex(sym2); * * cdef char* tocat(self, int sym): # <<<<<<<<<<<<<< @@ -23427,7 +24705,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tocat(struct __pyx_obj_4cdec_2sa_3 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tocat", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":40 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":40 * * cdef char* tocat(self, int sym): * return self.nonterminals.word((-sym >> INDEX_SHIFT)-1) # <<<<<<<<<<<<<< @@ -23437,13 +24715,21 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tocat(struct __pyx_obj_4cdec_2sa_3 __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->word(__pyx_v_self->nonterminals, (((-__pyx_v_sym) >> __pyx_v_4cdec_2sa_3_sa_INDEX_SHIFT) - 1)); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":39 + * return self.clearindex(sym1) == self.clearindex(sym2); + * + * cdef char* tocat(self, int sym): # <<<<<<<<<<<<<< + * return self.nonterminals.word((-sym >> INDEX_SHIFT)-1) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":42 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":42 * return self.nonterminals.word((-sym >> INDEX_SHIFT)-1) * * cdef int fromcat(self, char *s): # <<<<<<<<<<<<<< @@ -23458,7 +24744,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3 int __pyx_t_1; __Pyx_RefNannySetupContext("fromcat", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":44 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":44 * cdef int fromcat(self, char *s): * cdef int i * i = self.nonterminals.index(s) # <<<<<<<<<<<<<< @@ -23467,7 +24753,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3 */ __pyx_v_i = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->index(__pyx_v_self->nonterminals, __pyx_v_s); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":45 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":45 * cdef int i * i = self.nonterminals.index(s) * if self.first_nonterminal == -1: # <<<<<<<<<<<<<< @@ -23477,7 +24763,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3 __pyx_t_1 = ((__pyx_v_self->first_nonterminal == -1) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":46 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":46 * i = self.nonterminals.index(s) * if self.first_nonterminal == -1: * self.first_nonterminal = i # <<<<<<<<<<<<<< @@ -23489,7 +24775,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3 } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":47 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":47 * if self.first_nonterminal == -1: * self.first_nonterminal = i * if i > self.last_nonterminal: # <<<<<<<<<<<<<< @@ -23499,7 +24785,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3 __pyx_t_1 = ((__pyx_v_i > __pyx_v_self->last_nonterminal) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":48 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":48 * self.first_nonterminal = i * if i > self.last_nonterminal: * self.last_nonterminal = i # <<<<<<<<<<<<<< @@ -23511,7 +24797,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3 } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":49 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":49 * if i > self.last_nonterminal: * self.last_nonterminal = i * return -(i+1 << INDEX_SHIFT) # <<<<<<<<<<<<<< @@ -23521,13 +24807,21 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3 __pyx_r = (-((__pyx_v_i + 1) << __pyx_v_4cdec_2sa_3_sa_INDEX_SHIFT)); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":42 + * return self.nonterminals.word((-sym >> INDEX_SHIFT)-1) + * + * cdef int fromcat(self, char *s): # <<<<<<<<<<<<<< + * cdef int i + * i = self.nonterminals.index(s) + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":51 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":51 * return -(i+1 << INDEX_SHIFT) * * cdef char* tostring(self, int sym): # <<<<<<<<<<<<<< @@ -23542,15 +24836,15 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; - char *__pyx_t_4; - PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_4 = NULL; + char *__pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tostring", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":53 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":53 * cdef char* tostring(self, int sym): * cdef int ind * if self.isvar(sym): # <<<<<<<<<<<<<< @@ -23560,46 +24854,47 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s __pyx_t_1 = (((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->isvar(__pyx_v_self, __pyx_v_sym) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":54 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":54 * cdef int ind * 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_t_2 = __Pyx_PyInt_From_int(__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)) { + if (unlikely(__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;} } - __pyx_t_1 = (__Pyx_PyDict_Contains(__pyx_t_2, ((PyObject *)__pyx_v_self->id2sym), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PyDict_Contains(__pyx_t_2, __pyx_v_self->id2sym, Py_EQ)); if (unlikely(__pyx_t_1 < 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; __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":55 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":55 * 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)) { + if (unlikely(__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, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_sym); if (unlikely(!__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 = __Pyx_PyObject_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;} + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->id2sym, __pyx_t_2); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; + __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":56 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":56 * if sym in self.id2sym: * return self.id2sym[sym] * ind = self.getindex(sym) # <<<<<<<<<<<<<< @@ -23608,7 +24903,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s */ __pyx_v_ind = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->getindex(__pyx_v_self, __pyx_v_sym); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":57 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":57 * return self.id2sym[sym] * ind = self.getindex(sym) * if ind > 0: # <<<<<<<<<<<<<< @@ -23618,81 +24913,89 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s __pyx_t_3 = ((__pyx_v_ind > 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":58 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/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 = __Pyx_PyBytes_FromString(((struct __pyx_vtabstruct_4cdec_2sa_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 = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyBytes_FromString(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->tocat(__pyx_v_self, __pyx_v_sym)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __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)); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_4 = 0; __pyx_t_2 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_66), ((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 (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_d_2, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__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, 1, 1) < 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; + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_sym); 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); + if (unlikely(PyDict_SetItem(__pyx_v_self->id2sym, __pyx_t_6, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L5; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":60 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/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 = __Pyx_PyBytes_FromString(((struct __pyx_vtabstruct_4cdec_2sa_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_67), ((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 (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { + __pyx_t_2 = __Pyx_PyBytes_FromString(((struct __pyx_vtabstruct_4cdec_2sa_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 = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_s_2, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__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, 1, 1) < 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_t_2 = __Pyx_PyInt_From_int(__pyx_v_sym); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_v_self->id2sym, __pyx_t_2, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":61 * else: * self.id2sym[sym] = "[%s]" % self.tocat(sym) * return self.id2sym[sym] # <<<<<<<<<<<<<< * else: * return self.terminals.word(sym) */ - if (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { + if (unlikely(__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, 0, 1, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_sym); if (unlikely(!__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 = __Pyx_PyObject_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_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->id2sym, __pyx_t_6); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_4; + __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; goto __pyx_L0; - goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":63 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":63 * return self.id2sym[sym] * else: * return self.terminals.word(sym) # <<<<<<<<<<<<<< @@ -23702,22 +25005,28 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *)__pyx_v_self->terminals->__pyx_vtab)->word(__pyx_v_self->terminals, __pyx_v_sym); goto __pyx_L0; } - __pyx_L3:; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":51 + * return -(i+1 << INDEX_SHIFT) + * + * cdef char* tostring(self, int sym): # <<<<<<<<<<<<<< + * cdef int ind + * if self.isvar(sym): + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("cdec.sa._sa.Alphabet.tostring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.Alphabet.tostring", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":65 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":65 * return self.terminals.word(sym) * * cdef int fromstring(self, char *s, bint terminal): # <<<<<<<<<<<<<< @@ -23745,7 +25054,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fromstring", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":69 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":69 * cdef char *comma * cdef int n * n = strlen(s) # <<<<<<<<<<<<<< @@ -23754,16 +25063,16 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s */ __pyx_v_n = strlen(__pyx_v_s); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":71 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":71 * n = strlen(s) * cdef char *sep * sep = strstr(s,"_SEP_") # <<<<<<<<<<<<<< * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: * if terminal: */ - __pyx_v_sep = strstr(__pyx_v_s, __pyx_k___SEP_); + __pyx_v_sep = strstr(__pyx_v_s, __pyx_k_SEP); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":72 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/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: # <<<<<<<<<<<<<< @@ -23791,7 +25100,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s } if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/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: # <<<<<<<<<<<<<< @@ -23801,7 +25110,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s __pyx_t_2 = (__pyx_v_terminal != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":74 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":74 * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: * if terminal: * s1 = "\\"+s # <<<<<<<<<<<<<< @@ -23809,14 +25118,14 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s * s[n-1] = c'\0' */ __pyx_t_6 = __Pyx_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_68), ((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_6); + __pyx_t_7 = PyNumber_Add(__pyx_kp_s__45, __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_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_s1 = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":75 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":75 * if terminal: * s1 = "\\"+s * return self.terminals.index(s1) # <<<<<<<<<<<<<< @@ -23826,11 +25135,9 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s __pyx_t_8 = __Pyx_PyObject_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_4cdec_2sa_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:; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":76 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":76 * s1 = "\\"+s * return self.terminals.index(s1) * s[n-1] = c'\0' # <<<<<<<<<<<<<< @@ -23839,7 +25146,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s */ (__pyx_v_s[(__pyx_v_n - 1)]) = '\x00'; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":77 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":77 * return self.terminals.index(s1) * s[n-1] = c'\0' * s = s + 1 # <<<<<<<<<<<<<< @@ -23848,7 +25155,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s */ __pyx_v_s = (__pyx_v_s + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":78 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":78 * s[n-1] = c'\0' * s = s + 1 * comma = strrchr(s, c',') # <<<<<<<<<<<<<< @@ -23857,7 +25164,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s */ __pyx_v_comma = strrchr(__pyx_v_s, ','); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":79 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":79 * s = s + 1 * comma = strrchr(s, c',') * if comma != NULL: # <<<<<<<<<<<<<< @@ -23867,7 +25174,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s __pyx_t_2 = ((__pyx_v_comma != NULL) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":80 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":80 * comma = strrchr(s, c',') * if comma != NULL: * comma[0] = c'\0' # <<<<<<<<<<<<<< @@ -23876,7 +25183,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s */ (__pyx_v_comma[0]) = '\x00'; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":81 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":81 * if comma != NULL: * comma[0] = c'\0' * return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10)) # <<<<<<<<<<<<<< @@ -23885,11 +25192,10 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s */ __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->setindex(__pyx_v_self, ((struct __pyx_vtabstruct_4cdec_2sa_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*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":83 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":83 * return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10)) * else: * return self.fromcat(s) # <<<<<<<<<<<<<< @@ -23899,12 +25205,10 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->fromcat(__pyx_v_self, __pyx_v_s); goto __pyx_L0; } - __pyx_L5:; - goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":85 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":85 * return self.fromcat(s) * else: * return self.terminals.index(s) # <<<<<<<<<<<<<< @@ -23914,14 +25218,20 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *)__pyx_v_self->terminals->__pyx_vtab)->index(__pyx_v_self->terminals, __pyx_v_s); goto __pyx_L0; } - __pyx_L3:; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":65 + * return self.terminals.word(sym) + * + * cdef int fromstring(self, char *s, bint terminal): # <<<<<<<<<<<<<< + * """Warning: this method is allowed to alter s.""" + * cdef char *comma + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_WriteUnraisable("cdec.sa._sa.Alphabet.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.Alphabet.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s1); @@ -23929,6 +25239,14 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":8 + * + * cdef class Alphabet: + * cdef readonly StringMap terminals, nonterminals # <<<<<<<<<<<<<< + * cdef int first_nonterminal, last_nonterminal + * cdef dict id2sym + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_8Alphabet_9terminals_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_8Alphabet_9terminals_1__get__(PyObject *__pyx_v_self) { @@ -23936,18 +25254,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_8Alphabet_9terminals_1__get__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_8Alphabet_9terminals___get__(((struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":8 - * - * cdef class Alphabet: - * cdef readonly StringMap terminals, nonterminals # <<<<<<<<<<<<<< - * cdef int first_nonterminal, last_nonterminal - * cdef dict id2sym - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_8Alphabet_9terminals___get__(struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -23957,7 +25269,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8Alphabet_9terminals___get__(struct __p __pyx_r = ((PyObject *)__pyx_v_self->terminals); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -23971,6 +25283,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_8Alphabet_12nonterminals_1__get__(PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_8Alphabet_12nonterminals___get__(((struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -23984,14 +25298,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8Alphabet_12nonterminals___get__(struct __pyx_r = ((PyObject *)__pyx_v_self->nonterminals); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":89 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":89 * cdef Alphabet ALPHABET = Alphabet() * * cdef char* sym_tostring(int sym): # <<<<<<<<<<<<<< @@ -24004,7 +25318,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_sym_tostring(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_tostring", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":90 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":90 * * cdef char* sym_tostring(int sym): * return ALPHABET.tostring(sym) # <<<<<<<<<<<<<< @@ -24014,13 +25328,21 @@ static char *__pyx_f_4cdec_2sa_3_sa_sym_tostring(int __pyx_v_sym) { __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->tostring(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_sym); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":89 + * cdef Alphabet ALPHABET = Alphabet() + * + * cdef char* sym_tostring(int sym): # <<<<<<<<<<<<<< + * return ALPHABET.tostring(sym) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":92 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":92 * return ALPHABET.tostring(sym) * * cdef char* sym_tocat(int sym): # <<<<<<<<<<<<<< @@ -24033,7 +25355,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_sym_tocat(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_tocat", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":93 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":93 * * cdef char* sym_tocat(int sym): * return ALPHABET.tocat(sym) # <<<<<<<<<<<<<< @@ -24043,13 +25365,21 @@ static char *__pyx_f_4cdec_2sa_3_sa_sym_tocat(int __pyx_v_sym) { __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->tocat(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_sym); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":92 + * return ALPHABET.tostring(sym) + * + * cdef char* sym_tocat(int sym): # <<<<<<<<<<<<<< + * return ALPHABET.tocat(sym) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":95 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":95 * return ALPHABET.tocat(sym) * * cdef int sym_isvar(int sym): # <<<<<<<<<<<<<< @@ -24062,7 +25392,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_isvar(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_isvar", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":96 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":96 * * cdef int sym_isvar(int sym): * return ALPHABET.isvar(sym) # <<<<<<<<<<<<<< @@ -24072,13 +25402,21 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_isvar(int __pyx_v_sym) { __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->isvar(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_sym); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":95 + * return ALPHABET.tocat(sym) + * + * cdef int sym_isvar(int sym): # <<<<<<<<<<<<<< + * return ALPHABET.isvar(sym) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":98 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":98 * return ALPHABET.isvar(sym) * * cdef int sym_getindex(int sym): # <<<<<<<<<<<<<< @@ -24091,7 +25429,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_getindex(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_getindex", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":99 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":99 * * cdef int sym_getindex(int sym): * return ALPHABET.getindex(sym) # <<<<<<<<<<<<<< @@ -24101,13 +25439,21 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_getindex(int __pyx_v_sym) { __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->getindex(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_sym); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":98 + * return ALPHABET.isvar(sym) + * + * cdef int sym_getindex(int sym): # <<<<<<<<<<<<<< + * return ALPHABET.getindex(sym) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":101 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":101 * return ALPHABET.getindex(sym) * * cdef int sym_setindex(int sym, int id): # <<<<<<<<<<<<<< @@ -24120,7 +25466,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id) __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_setindex", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":102 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":102 * * cdef int sym_setindex(int sym, int id): * return ALPHABET.setindex(sym, id) # <<<<<<<<<<<<<< @@ -24130,13 +25476,21 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id) __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->setindex(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_sym, __pyx_v_id); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":101 + * return ALPHABET.getindex(sym) + * + * cdef int sym_setindex(int sym, int id): # <<<<<<<<<<<<<< + * return ALPHABET.setindex(sym, id) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":104 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":104 * return ALPHABET.setindex(sym, id) * * cdef int sym_fromstring(char* string, bint terminal): # <<<<<<<<<<<<<< @@ -24149,7 +25503,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_fromstring", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":105 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":105 * * cdef int sym_fromstring(char* string, bint terminal): * return ALPHABET.fromstring(string, terminal) # <<<<<<<<<<<<<< @@ -24159,12 +25513,28 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->fromstring(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_string, __pyx_v_terminal); goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":104 + * return ALPHABET.setindex(sym, id) + * + * cdef int sym_fromstring(char* string, bint terminal): # <<<<<<<<<<<<<< + * return ALPHABET.fromstring(string, terminal) + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":107 + * return ALPHABET.fromstring(string, terminal) + * + * def isvar(sym): # <<<<<<<<<<<<<< + * return sym_isvar(sym) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5isvar(PyObject *__pyx_self, PyObject *__pyx_v_sym); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_5isvar = {__Pyx_NAMESTR("isvar"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5isvar, METH_O, __Pyx_DOCSTR(0)}; @@ -24173,18 +25543,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_5isvar(PyObject *__pyx_self, PyObject * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isvar (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_4isvar(__pyx_self, ((PyObject *)__pyx_v_sym)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":107 - * return ALPHABET.fromstring(string, terminal) - * - * def isvar(sym): # <<<<<<<<<<<<<< - * return sym_isvar(sym) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sym) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -24195,7 +25559,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isvar", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":108 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":108 * * def isvar(sym): * return sym_isvar(sym) # <<<<<<<<<<<<<< @@ -24203,15 +25567,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_se * def make_lattice(words): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_sym); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_sym); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":107 + * return ALPHABET.fromstring(string, terminal) + * + * def isvar(sym): # <<<<<<<<<<<<<< + * return sym_isvar(sym) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.isvar", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -24222,6 +25593,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_se return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":110 + * return sym_isvar(sym) + * + * def make_lattice(words): # <<<<<<<<<<<<<< + * word_ids = (sym_fromstring(word, True) for word in words) + * return tuple(((word, None, 1), ) for word in word_ids) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7make_lattice(PyObject *__pyx_self, PyObject *__pyx_v_words); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_7make_lattice = {__Pyx_NAMESTR("make_lattice"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7make_lattice, METH_O, __Pyx_DOCSTR(0)}; @@ -24230,12 +25609,14 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7make_lattice(PyObject *__pyx_self, PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_lattice (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6make_lattice(__pyx_self, ((PyObject *)__pyx_v_words)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":111 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":111 * * def make_lattice(words): * word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -24267,6 +25648,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12make_lattice_genexpr(PyObject *__pyx_ return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -24329,8 +25711,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator7(__pyx_Genera } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -24342,7 +25725,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator7(__pyx_Genera __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_cur_scope->__pyx_v_word); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_5, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_5, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -24364,6 +25747,8 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator7(__pyx_Genera if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -24379,7 +25764,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator7(__pyx_Genera } static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":112 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":112 * def make_lattice(words): * word_ids = (sym_fromstring(word, True) for word in words) * return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<< @@ -24411,6 +25796,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12make_lattice_3genexpr(PyObject *__pyx return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -24473,8 +25859,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator8(__pyx_Genera } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -24498,10 +25885,10 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator8(__pyx_Genera __Pyx_GIVEREF(__pyx_int_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = ((PyObject *)__pyx_t_5); + __pyx_r = __pyx_t_5; __pyx_t_5 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; @@ -24521,6 +25908,8 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator8(__pyx_Genera if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -24536,7 +25925,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator8(__pyx_Genera return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":110 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":110 * return sym_isvar(sym) * * def make_lattice(words): # <<<<<<<<<<<<<< @@ -24564,7 +25953,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6make_lattice(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":111 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":111 * * def make_lattice(words): * word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -24577,7 +25966,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6make_lattice(CYTHON_UNUSED PyObject *_ __pyx_cur_scope->__pyx_v_word_ids = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":112 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":112 * def make_lattice(words): * word_ids = (sym_fromstring(word, True) for word in words) * return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<< @@ -24592,15 +25981,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6make_lattice(CYTHON_UNUSED PyObject *_ 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*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":110 + * return sym_isvar(sym) + * + * def make_lattice(words): # <<<<<<<<<<<<<< + * word_ids = (sym_fromstring(word, True) for word in words) + * return tuple(((word, None, 1), ) for word in word_ids) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -24613,6 +26009,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6make_lattice(CYTHON_UNUSED PyObject *_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":114 + * return tuple(((word, None, 1), ) for word in word_ids) + * + * def decode_lattice(lattice): # <<<<<<<<<<<<<< + * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc + * for arc in node for node in lattice) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9decode_lattice(PyObject *__pyx_self, PyObject *__pyx_v_lattice); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_9decode_lattice = {__Pyx_NAMESTR("decode_lattice"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9decode_lattice, METH_O, __Pyx_DOCSTR(0)}; @@ -24621,12 +26025,14 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9decode_lattice(PyObject *__pyx_self, P __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decode_lattice (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_8decode_lattice(__pyx_self, ((PyObject *)__pyx_v_lattice)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":115 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< @@ -24658,6 +26064,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14decode_lattice_genexpr(PyObject *__py return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -24703,7 +26110,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":116 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":116 * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc * for arc in node for node in lattice) # <<<<<<<<<<<<<< @@ -24711,6 +26118,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene * def decode_sentence(lattice): */ if (unlikely(!__pyx_cur_scope->__pyx_v_arc)) { __Pyx_RaiseUnboundLocalError("arc"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":115 + * + * def decode_lattice(lattice): + * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< + * for arc in node for node in lattice) + * + */ if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_arc) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_arc)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_arc; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; @@ -24720,14 +26135,6 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { - - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":115 - * - * def decode_lattice(lattice): - * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< - * for arc in node for node in lattice) - * - */ 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 @@ -24745,8 +26152,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -24787,8 +26195,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); @@ -24824,7 +26231,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":116 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":116 * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc * for arc in node for node in lattice) # <<<<<<<<<<<<<< @@ -24858,16 +26265,17 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene } else { __pyx_t_7 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_7)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_arc); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_arc, __pyx_t_7); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_arc); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_arc, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice)) { __Pyx_RaiseClosureNameError("lattice"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } @@ -24897,33 +26305,34 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene } else { __pyx_t_6 = __pyx_t_13(__pyx_t_7); if (unlikely(!__pyx_t_6)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_6); } - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_node); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_6); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_node); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":115 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< * for arc in node for node in lattice) * */ - __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_14)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_weight); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_cur_scope->__pyx_v_weight); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_weight); @@ -24931,7 +26340,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_cur_scope->__pyx_v_dist); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dist); __pyx_t_6 = 0; - __pyx_r = ((PyObject *)__pyx_t_5); + __pyx_r = __pyx_t_5; __pyx_t_5 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; @@ -24973,6 +26382,8 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -24991,7 +26402,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":114 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":114 * return tuple(((word, None, 1), ) for word in word_ids) * * def decode_lattice(lattice): # <<<<<<<<<<<<<< @@ -25019,7 +26430,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8decode_lattice(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":115 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< @@ -25034,15 +26445,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8decode_lattice(CYTHON_UNUSED PyObject 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*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":114 + * return tuple(((word, None, 1), ) for word in word_ids) + * + * def decode_lattice(lattice): # <<<<<<<<<<<<<< + * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc + * for arc in node for node in lattice) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -25055,6 +26473,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8decode_lattice(CYTHON_UNUSED PyObject return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":118 + * for arc in node for node in lattice) + * + * def decode_sentence(lattice): # <<<<<<<<<<<<<< + * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11decode_sentence(PyObject *__pyx_self, PyObject *__pyx_v_lattice); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11decode_sentence = {__Pyx_NAMESTR("decode_sentence"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11decode_sentence, METH_O, __Pyx_DOCSTR(0)}; @@ -25063,12 +26489,14 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11decode_sentence(PyObject *__pyx_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decode_sentence (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_10decode_sentence(__pyx_self, ((PyObject *)__pyx_v_lattice)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":119 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":119 * * def decode_sentence(lattice): * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<< @@ -25100,6 +26528,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_15decode_sentence_genexpr(PyObject *__p return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -25168,8 +26597,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10(__pyx_Ge } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -25200,8 +26630,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10(__pyx_Ge __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); @@ -25254,8 +26683,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10(__pyx_Ge __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); @@ -25290,10 +26718,10 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10(__pyx_Ge __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_11)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_r = ((PyObject *)__pyx_t_4); + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; @@ -25313,6 +26741,8 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10(__pyx_Ge if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -25332,7 +26762,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10(__pyx_Ge return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":118 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":118 * for arc in node for node in lattice) * * def decode_sentence(lattice): # <<<<<<<<<<<<<< @@ -25360,7 +26790,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_10decode_sentence(CYTHON_UNUSED PyObjec __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":119 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":119 * * def decode_sentence(lattice): * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<< @@ -25375,15 +26805,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_10decode_sentence(CYTHON_UNUSED PyObjec 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*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":118 + * for arc in node for node in lattice) + * + * def decode_sentence(lattice): # <<<<<<<<<<<<<< + * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -25396,6 +26833,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_10decode_sentence(CYTHON_UNUSED PyObjec return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":121 + * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) + * + * def encode_words(words): # <<<<<<<<<<<<<< + * return tuple(sym_fromstring(word, True) for word in words) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13encode_words(PyObject *__pyx_self, PyObject *__pyx_v_words); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_13encode_words = {__Pyx_NAMESTR("encode_words"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_13encode_words, METH_O, __Pyx_DOCSTR(0)}; @@ -25404,12 +26849,14 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13encode_words(PyObject *__pyx_self, Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("encode_words (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_12encode_words(__pyx_self, ((PyObject *)__pyx_v_words)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":122 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":122 * * def encode_words(words): * return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -25441,6 +26888,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12encode_words_genexpr(PyObject *__pyx_ return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -25503,8 +26951,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator11(__pyx_Gener } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -25516,7 +26965,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator11(__pyx_Gener __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_cur_scope->__pyx_v_word); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_5, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_5, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -25538,6 +26987,8 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator11(__pyx_Gener if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -25552,7 +27003,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator11(__pyx_Gener return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":121 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":121 * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) * * def encode_words(words): # <<<<<<<<<<<<<< @@ -25580,7 +27031,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12encode_words(CYTHON_UNUSED PyObject * __Pyx_INCREF(__pyx_cur_scope->__pyx_v_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":122 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":122 * * def encode_words(words): * return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -25595,15 +27046,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12encode_words(CYTHON_UNUSED PyObject * 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*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":121 + * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) + * + * def encode_words(words): # <<<<<<<<<<<<<< + * return tuple(sym_fromstring(word, True) for word in words) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -25616,6 +27074,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12encode_words(CYTHON_UNUSED PyObject * return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":124 + * return tuple(sym_fromstring(word, True) for word in words) + * + * def decode_words(syms): # <<<<<<<<<<<<<< + * return tuple(sym_tostring(sym) for sym in syms) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_15decode_words(PyObject *__pyx_self, PyObject *__pyx_v_syms); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_15decode_words = {__Pyx_NAMESTR("decode_words"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_15decode_words, METH_O, __Pyx_DOCSTR(0)}; @@ -25624,12 +27089,14 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_15decode_words(PyObject *__pyx_self, Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decode_words (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_14decode_words(__pyx_self, ((PyObject *)__pyx_v_syms)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":125 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":125 * * def decode_words(syms): * return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<< @@ -25659,6 +27126,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12decode_words_genexpr(PyObject *__pyx_ return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -25721,8 +27189,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator12(__pyx_Gener } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -25733,10 +27202,10 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator12(__pyx_Gener __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sym, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_r = ((PyObject *)__pyx_t_4); + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; @@ -25756,6 +27225,8 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator12(__pyx_Gener if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -25770,7 +27241,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator12(__pyx_Gener return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":124 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":124 * return tuple(sym_fromstring(word, True) for word in words) * * def decode_words(syms): # <<<<<<<<<<<<<< @@ -25797,7 +27268,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14decode_words(CYTHON_UNUSED PyObject * __Pyx_INCREF(__pyx_cur_scope->__pyx_v_syms); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_syms); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":125 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":125 * * def decode_words(syms): * return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<< @@ -25810,15 +27281,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14decode_words(CYTHON_UNUSED PyObject * 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*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":124 + * return tuple(sym_fromstring(word, True) for word in words) + * + * def decode_words(syms): # <<<<<<<<<<<<<< + * return tuple(sym_tostring(sym) for sym in syms) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -25831,6 +27308,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14decode_words(CYTHON_UNUSED PyObject * return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":6 + * cdef class Phrase: + * + * def __cinit__(self, words): # <<<<<<<<<<<<<< + * cdef int i, j, n, n_vars + * n_vars = 0 + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -25842,7 +27327,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__words,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_words,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -25855,7 +27340,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, Py kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__words)) != 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)) { @@ -25877,18 +27362,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, Py return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self), __pyx_v_words); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/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_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_words) { int __pyx_v_i; int __pyx_v_j; @@ -25906,7 +27385,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":8 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":8 * def __cinit__(self, words): * cdef int i, j, n, n_vars * n_vars = 0 # <<<<<<<<<<<<<< @@ -25915,7 +27394,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ */ __pyx_v_n_vars = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":9 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":9 * cdef int i, j, n, n_vars * n_vars = 0 * n = len(words) # <<<<<<<<<<<<<< @@ -25925,7 +27404,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":10 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":10 * n_vars = 0 * n = len(words) * self.syms = malloc(n*sizeof(int)) # <<<<<<<<<<<<<< @@ -25934,7 +27413,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ */ __pyx_v_self->syms = ((int *)malloc((__pyx_v_n * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":11 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":11 * n = len(words) * self.syms = malloc(n*sizeof(int)) * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -25944,20 +27423,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":12 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":12 * self.syms = malloc(n*sizeof(int)) * for i from 0 <= i < n: * self.syms[i] = words[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, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_words, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__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 = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_As_int(__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; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":13 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":13 * for i from 0 <= i < n: * self.syms[i] = words[i] * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< @@ -25967,7 +27446,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ __pyx_t_5 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":14 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":14 * self.syms[i] = words[i] * if sym_isvar(self.syms[i]): * n_vars += 1 # <<<<<<<<<<<<<< @@ -25980,7 +27459,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ __pyx_L5:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":15 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":15 * if sym_isvar(self.syms[i]): * n_vars += 1 * self.n = n # <<<<<<<<<<<<<< @@ -25989,7 +27468,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ */ __pyx_v_self->n = __pyx_v_n; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":16 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":16 * n_vars += 1 * self.n = n * self.n_vars = n_vars # <<<<<<<<<<<<<< @@ -25998,7 +27477,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ */ __pyx_v_self->n_vars = __pyx_v_n_vars; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":17 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":17 * self.n = n * self.n_vars = n_vars * self.varpos = malloc(n_vars*sizeof(int)) # <<<<<<<<<<<<<< @@ -26007,7 +27486,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ */ __pyx_v_self->varpos = ((int *)malloc((__pyx_v_n_vars * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":18 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":18 * self.n_vars = n_vars * self.varpos = malloc(n_vars*sizeof(int)) * j = 0 # <<<<<<<<<<<<<< @@ -26016,7 +27495,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ */ __pyx_v_j = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":19 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":19 * self.varpos = malloc(n_vars*sizeof(int)) * j = 0 * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -26026,7 +27505,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":20 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":20 * j = 0 * for i from 0 <= i < n: * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< @@ -26036,7 +27515,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ __pyx_t_5 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":21 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":21 * for i from 0 <= i < n: * if sym_isvar(self.syms[i]): * self.varpos[j] = i # <<<<<<<<<<<<<< @@ -26045,7 +27524,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ */ (__pyx_v_self->varpos[__pyx_v_j]) = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":22 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":22 * if sym_isvar(self.syms[i]): * self.varpos[j] = i * j = j + 1 # <<<<<<<<<<<<<< @@ -26058,6 +27537,15 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ __pyx_L8:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":6 + * cdef class Phrase: + * + * def __cinit__(self, words): # <<<<<<<<<<<<<< + * cdef int i, j, n, n_vars + * n_vars = 0 + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -26069,28 +27557,30 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":24 + * j = j + 1 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.syms) + * free(self.varpos) + */ + /* Python wrapper */ static void __pyx_pw_4cdec_2sa_3_sa_6Phrase_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4cdec_2sa_3_sa_6Phrase_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_4cdec_2sa_3_sa_6Phrase_2__dealloc__(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":24 - * j = j + 1 - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self.syms) - * free(self.varpos) - */ - static void __pyx_pf_4cdec_2sa_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":25 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":25 * * def __dealloc__(self): * free(self.syms) # <<<<<<<<<<<<<< @@ -26099,7 +27589,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_4cdec_ */ free(__pyx_v_self->syms); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":26 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":26 * def __dealloc__(self): * free(self.syms) * free(self.varpos) # <<<<<<<<<<<<<< @@ -26108,9 +27598,26 @@ static void __pyx_pf_4cdec_2sa_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_4cdec_ */ free(__pyx_v_self->varpos); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":24 + * j = j + 1 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.syms) + * free(self.varpos) + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":28 + * free(self.varpos) + * + * def __str__(self): # <<<<<<<<<<<<<< + * strs = [] + * cdef int i, s + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_5__str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_5__str__(PyObject *__pyx_v_self) { @@ -26118,18 +27625,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_5__str__(PyObject *__pyx_v_self __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":28 - * free(self.varpos) - * - * def __str__(self): # <<<<<<<<<<<<<< - * strs = [] - * cdef int i, s - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self) { PyObject *__pyx_v_strs = NULL; int __pyx_v_i; @@ -26139,14 +27640,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":29 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":29 * * def __str__(self): * strs = [] # <<<<<<<<<<<<<< @@ -26158,7 +27657,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec __pyx_v_strs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":31 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":31 * strs = [] * cdef int i, s * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -26168,7 +27667,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":32 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":32 * cdef int i, s * for i from 0 <= i < self.n: * s = self.syms[i] # <<<<<<<<<<<<<< @@ -26177,7 +27676,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":33 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":33 * for i from 0 <= i < self.n: * s = self.syms[i] * strs.append(sym_tostring(s)) # <<<<<<<<<<<<<< @@ -26185,12 +27684,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec * */ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_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 = __Pyx_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; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_strs, __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(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":34 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":34 * s = self.syms[i] * strs.append(sym_tostring(s)) * return ' '.join(strs) # <<<<<<<<<<<<<< @@ -26198,27 +27697,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec * def handle(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __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_t_1 = __Pyx_PyString_Join(__pyx_kp_s__46, __pyx_v_strs); 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 = 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 = 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; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":28 + * free(self.varpos) + * + * def __str__(self): # <<<<<<<<<<<<<< + * strs = [] + * cdef int i, s + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cdec.sa._sa.Phrase.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -26228,6 +27723,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":36 + * return ' '.join(strs) + * + * def handle(self): # <<<<<<<<<<<<<< + * """return a hashable representation that normalizes the ordering + * of the nonterminal indices""" + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_7handle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_4cdec_2sa_3_sa_6Phrase_6handle[] = "return a hashable representation that normalizes the ordering\n of the nonterminal indices"; @@ -26236,18 +27739,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_7handle(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":36 - * return ' '.join(strs) - * - * def handle(self): # <<<<<<<<<<<<<< - * """return a hashable representation that normalizes the ordering - * of the nonterminal indices""" - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self) { PyObject *__pyx_v_norm = NULL; int __pyx_v_i; @@ -26264,7 +27761,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":39 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":39 * """return a hashable representation that normalizes the ordering * of the nonterminal indices""" * norm = [] # <<<<<<<<<<<<<< @@ -26276,7 +27773,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ __pyx_v_norm = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":41 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":41 * norm = [] * cdef int i, j, s * i = 1 # <<<<<<<<<<<<<< @@ -26285,7 +27782,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":42 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":42 * cdef int i, j, s * i = 1 * j = 0 # <<<<<<<<<<<<<< @@ -26294,7 +27791,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ */ __pyx_v_j = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":43 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":43 * i = 1 * j = 0 * for j from 0 <= j < self.n: # <<<<<<<<<<<<<< @@ -26304,7 +27801,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":44 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":44 * j = 0 * for j from 0 <= j < self.n: * s = self.syms[j] # <<<<<<<<<<<<<< @@ -26313,7 +27810,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":45 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":45 * for j from 0 <= j < self.n: * s = self.syms[j] * if sym_isvar(s): # <<<<<<<<<<<<<< @@ -26323,7 +27820,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ __pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_v_s) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":46 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":46 * s = self.syms[j] * if sym_isvar(s): * s = sym_setindex(s,i) # <<<<<<<<<<<<<< @@ -26332,7 +27829,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ */ __pyx_v_s = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":47 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":47 * if sym_isvar(s): * s = sym_setindex(s,i) * i = i + 1 # <<<<<<<<<<<<<< @@ -26344,20 +27841,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":48 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/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 = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__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 = __Pyx_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; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":49 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":49 * i = i + 1 * norm.append(s) * return tuple(norm) # <<<<<<<<<<<<<< @@ -26365,14 +27862,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ * 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 = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_r = ((PyObject *)__pyx_t_1); + __pyx_t_1 = 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(__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; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":36 + * return ' '.join(strs) + * + * def handle(self): # <<<<<<<<<<<<<< + * """return a hashable representation that normalizes the ordering + * of the nonterminal indices""" + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.Phrase.handle", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -26384,6 +27888,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":51 + * return tuple(norm) + * + * def strhandle(self): # <<<<<<<<<<<<<< + * norm = [] + * cdef int i, j, s + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_9strhandle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_9strhandle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { @@ -26391,18 +27903,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_9strhandle(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strhandle (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":51 - * return tuple(norm) - * - * def strhandle(self): # <<<<<<<<<<<<<< - * norm = [] - * cdef int i, j, s - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self) { PyObject *__pyx_v_norm = NULL; int __pyx_v_i; @@ -26414,14 +27920,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strhandle", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":52 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":52 * * def strhandle(self): * norm = [] # <<<<<<<<<<<<<< @@ -26433,7 +27937,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd __pyx_v_norm = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":54 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":54 * norm = [] * cdef int i, j, s * i = 1 # <<<<<<<<<<<<<< @@ -26442,7 +27946,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":55 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":55 * cdef int i, j, s * i = 1 * j = 0 # <<<<<<<<<<<<<< @@ -26451,7 +27955,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd */ __pyx_v_j = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":56 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":56 * i = 1 * j = 0 * for j from 0 <= j < self.n: # <<<<<<<<<<<<<< @@ -26461,7 +27965,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":57 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":57 * j = 0 * for j from 0 <= j < self.n: * s = self.syms[j] # <<<<<<<<<<<<<< @@ -26470,7 +27974,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":58 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":58 * for j from 0 <= j < self.n: * s = self.syms[j] * if sym_isvar(s): # <<<<<<<<<<<<<< @@ -26480,7 +27984,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd __pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_v_s) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":59 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":59 * s = self.syms[j] * if sym_isvar(s): * s = sym_setindex(s,i) # <<<<<<<<<<<<<< @@ -26489,7 +27993,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd */ __pyx_v_s = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":60 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":60 * if sym_isvar(s): * s = sym_setindex(s,i) * i = i + 1 # <<<<<<<<<<<<<< @@ -26501,7 +28005,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":61 * s = sym_setindex(s,i) * i = i + 1 * norm.append(sym_tostring(s)) # <<<<<<<<<<<<<< @@ -26509,12 +28013,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd * */ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_v_s)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_norm, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_norm, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":62 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":62 * i = i + 1 * norm.append(sym_tostring(s)) * return ' '.join(norm) # <<<<<<<<<<<<<< @@ -26522,27 +28026,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd * def arity(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__46, __pyx_v_norm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 62; __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 = 62; __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 = 62; __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; - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":51 + * return tuple(norm) + * + * def strhandle(self): # <<<<<<<<<<<<<< + * norm = [] + * cdef int i, j, s + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("cdec.sa._sa.Phrase.strhandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -26552,6 +28052,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":64 + * return ' '.join(norm) + * + * def arity(self): # <<<<<<<<<<<<<< + * return self.n_vars + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_11arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_11arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { @@ -26559,18 +28067,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_11arity(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arity (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_10arity(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":64 - * return ' '.join(norm) - * - * def arity(self): # <<<<<<<<<<<<<< - * return self.n_vars - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_10arity(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -26580,7 +28082,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_10arity(struct __pyx_obj_4cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arity", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":65 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":65 * * def arity(self): * return self.n_vars # <<<<<<<<<<<<<< @@ -26588,14 +28090,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_10arity(struct __pyx_obj_4cdec_ * 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 = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 65; __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; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":64 + * return ' '.join(norm) + * + * def arity(self): # <<<<<<<<<<<<<< + * return self.n_vars + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.Phrase.arity", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -26606,6 +28115,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_10arity(struct __pyx_obj_4cdec_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":67 + * return self.n_vars + * + * def getvarpos(self, i): # <<<<<<<<<<<<<< + * if 0 <= i < self.n_vars: + * return self.varpos[i] + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_13getvarpos(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_13getvarpos(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -26613,18 +28130,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_13getvarpos(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getvarpos (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":67 - * return self.n_vars - * - * def getvarpos(self, i): # <<<<<<<<<<<<<< - * if 0 <= i < self.n_vars: - * return self.varpos[i] - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -26637,7 +28148,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getvarpos", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":68 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":68 * * def getvarpos(self, i): * if 0 <= i < self.n_vars: # <<<<<<<<<<<<<< @@ -26647,7 +28158,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 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 = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 68; __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); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -26656,7 +28167,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":69 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":69 * def getvarpos(self, i): * if 0 <= i < self.n_vars: * return self.varpos[i] # <<<<<<<<<<<<<< @@ -26665,16 +28176,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c */ __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 = 69; __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->varpos[__pyx_t_4])); 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_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":71 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":71 * return self.varpos[i] * else: * raise IndexError # <<<<<<<<<<<<<< @@ -26684,10 +28194,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_L3:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":67 + * return self.n_vars + * + * def getvarpos(self, i): # <<<<<<<<<<<<<< + * if 0 <= i < self.n_vars: + * return self.varpos[i] + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -26699,6 +28215,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":73 + * raise IndexError + * + * def getvar(self, i): # <<<<<<<<<<<<<< + * if 0 <= i < self.n_vars: + * return self.syms[self.varpos[i]] + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_15getvar(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_15getvar(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -26706,18 +28230,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_15getvar(PyObject *__pyx_v_self __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getvar (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":73 - * raise IndexError - * - * def getvar(self, i): # <<<<<<<<<<<<<< - * if 0 <= i < self.n_vars: - * return self.syms[self.varpos[i]] - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -26730,7 +28248,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getvar", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":74 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":74 * * def getvar(self, i): * if 0 <= i < self.n_vars: # <<<<<<<<<<<<<< @@ -26740,7 +28258,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 74; __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); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -26749,7 +28267,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":75 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":75 * def getvar(self, i): * if 0 <= i < self.n_vars: * return self.syms[self.varpos[i]] # <<<<<<<<<<<<<< @@ -26758,16 +28276,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec */ __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 = 75; __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 = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->syms[(__pyx_v_self->varpos[__pyx_t_4])])); 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_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":77 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":77 * return self.syms[self.varpos[i]] * else: * raise IndexError # <<<<<<<<<<<<<< @@ -26777,10 +28294,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_L3:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":73 + * raise IndexError + * + * def getvar(self, i): # <<<<<<<<<<<<<< + * if 0 <= i < self.n_vars: + * return self.syms[self.varpos[i]] + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -26792,7 +28315,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":79 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":79 * raise IndexError * * cdef int chunkpos(self, int k): # <<<<<<<<<<<<<< @@ -26806,7 +28329,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunkpos(struct __pyx_obj_4cdec_2sa_3_sa_Phra int __pyx_t_1; __Pyx_RefNannySetupContext("chunkpos", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":80 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":80 * * cdef int chunkpos(self, int k): * if k == 0: # <<<<<<<<<<<<<< @@ -26816,7 +28339,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunkpos(struct __pyx_obj_4cdec_2sa_3_sa_Phra __pyx_t_1 = ((__pyx_v_k == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":81 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":81 * cdef int chunkpos(self, int k): * if k == 0: * return 0 # <<<<<<<<<<<<<< @@ -26825,11 +28348,10 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunkpos(struct __pyx_obj_4cdec_2sa_3_sa_Phra */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":83 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":83 * return 0 * else: * return self.varpos[k-1]+1 # <<<<<<<<<<<<<< @@ -26839,15 +28361,22 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunkpos(struct __pyx_obj_4cdec_2sa_3_sa_Phra __pyx_r = ((__pyx_v_self->varpos[(__pyx_v_k - 1)]) + 1); goto __pyx_L0; } - __pyx_L3:; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":79 + * raise IndexError + * + * cdef int chunkpos(self, int k): # <<<<<<<<<<<<<< + * if k == 0: + * return 0 + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":85 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":85 * return self.varpos[k-1]+1 * * cdef int chunklen(self, int k): # <<<<<<<<<<<<<< @@ -26861,7 +28390,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra int __pyx_t_1; __Pyx_RefNannySetupContext("chunklen", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":86 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":86 * * cdef int chunklen(self, int k): * if self.n_vars == 0: # <<<<<<<<<<<<<< @@ -26871,7 +28400,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra __pyx_t_1 = ((__pyx_v_self->n_vars == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":87 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":87 * cdef int chunklen(self, int k): * if self.n_vars == 0: * return self.n # <<<<<<<<<<<<<< @@ -26880,10 +28409,9 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra */ __pyx_r = __pyx_v_self->n; goto __pyx_L0; - goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":88 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":88 * if self.n_vars == 0: * return self.n * elif k == 0: # <<<<<<<<<<<<<< @@ -26893,7 +28421,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra __pyx_t_1 = ((__pyx_v_k == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":89 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":89 * return self.n * elif k == 0: * return self.varpos[0] # <<<<<<<<<<<<<< @@ -26902,10 +28430,9 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra */ __pyx_r = (__pyx_v_self->varpos[0]); goto __pyx_L0; - goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":90 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":90 * elif k == 0: * return self.varpos[0] * elif k == self.n_vars: # <<<<<<<<<<<<<< @@ -26915,7 +28442,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra __pyx_t_1 = ((__pyx_v_k == __pyx_v_self->n_vars) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":91 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":91 * return self.varpos[0] * elif k == self.n_vars: * return self.n-self.varpos[k-1]-1 # <<<<<<<<<<<<<< @@ -26924,11 +28451,10 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra */ __pyx_r = ((__pyx_v_self->n - (__pyx_v_self->varpos[(__pyx_v_k - 1)])) - 1); goto __pyx_L0; - goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":93 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":93 * return self.n-self.varpos[k-1]-1 * else: * return self.varpos[k]-self.varpos[k-1]-1 # <<<<<<<<<<<<<< @@ -26938,14 +28464,29 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra __pyx_r = (((__pyx_v_self->varpos[__pyx_v_k]) - (__pyx_v_self->varpos[(__pyx_v_k - 1)])) - 1); goto __pyx_L0; } - __pyx_L3:; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":85 + * return self.varpos[k-1]+1 + * + * cdef int chunklen(self, int k): # <<<<<<<<<<<<<< + * if self.n_vars == 0: + * return self.n + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":95 + * return self.varpos[k]-self.varpos[k-1]-1 + * + * def clen(self, k): # <<<<<<<<<<<<<< + * return self.chunklen(k) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_17clen(PyObject *__pyx_v_self, PyObject *__pyx_v_k); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_17clen(PyObject *__pyx_v_self, PyObject *__pyx_v_k) { @@ -26953,18 +28494,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_17clen(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clen (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_16clen(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_k)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":95 - * return self.varpos[k]-self.varpos[k-1]-1 - * - * def clen(self, k): # <<<<<<<<<<<<<< - * return self.chunklen(k) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_16clen(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_k) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -26975,7 +28510,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_16clen(struct __pyx_obj_4cdec_2 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clen", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":96 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":96 * * def clen(self, k): * return self.chunklen(k) # <<<<<<<<<<<<<< @@ -26983,15 +28518,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_16clen(struct __pyx_obj_4cdec_2 * 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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_k); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_4cdec_2sa_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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":95 + * return self.varpos[k]-self.varpos[k-1]-1 + * + * def clen(self, k): # <<<<<<<<<<<<<< + * return self.chunklen(k) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.Phrase.clen", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -27002,6 +28544,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_16clen(struct __pyx_obj_4cdec_2 return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":98 + * return self.chunklen(k) + * + * def getchunk(self, ci): # <<<<<<<<<<<<<< + * cdef int start, stop + * start = self.chunkpos(ci) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_19getchunk(PyObject *__pyx_v_self, PyObject *__pyx_v_ci); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_19getchunk(PyObject *__pyx_v_self, PyObject *__pyx_v_ci) { @@ -27009,18 +28559,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_19getchunk(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getchunk (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_ci)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":98 - * return self.chunklen(k) - * - * def getchunk(self, ci): # <<<<<<<<<<<<<< - * cdef int start, stop - * start = self.chunkpos(ci) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_ci) { int __pyx_v_start; int __pyx_v_stop; @@ -27036,27 +28580,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getchunk", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":100 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":100 * 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 = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_start = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunkpos(__pyx_v_self, __pyx_t_1); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":101 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":101 * 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 = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__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_stop = (__pyx_v_start + ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunklen(__pyx_v_self, __pyx_t_1)); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":102 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":102 * start = self.chunkpos(ci) * stop = start+self.chunklen(ci) * chunk = [] # <<<<<<<<<<<<<< @@ -27068,7 +28612,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd __pyx_v_chunk = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":103 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":103 * stop = start+self.chunklen(ci) * chunk = [] * for i from start <= i < stop: # <<<<<<<<<<<<<< @@ -27078,20 +28622,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd __pyx_t_1 = __pyx_v_stop; for (__pyx_v_i = __pyx_v_start; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":104 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":104 * 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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->syms[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_chunk, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":105 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":105 * for i from start <= i < stop: * chunk.append(self.syms[i]) * return chunk # <<<<<<<<<<<<<< @@ -27099,12 +28643,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd * def __cmp__(self, other): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_chunk)); - __pyx_r = ((PyObject *)__pyx_v_chunk); + __Pyx_INCREF(__pyx_v_chunk); + __pyx_r = __pyx_v_chunk; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":98 + * return self.chunklen(k) + * + * def getchunk(self, ci): # <<<<<<<<<<<<<< + * cdef int start, stop + * start = self.chunkpos(ci) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.Phrase.getchunk", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -27116,6 +28667,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":107 + * return chunk + * + * def __cmp__(self, other): # <<<<<<<<<<<<<< + * cdef Phrase otherp + * cdef int i + */ + /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static int __pyx_pw_4cdec_2sa_3_sa_6Phrase_21__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ @@ -27124,35 +28683,30 @@ static int __pyx_pw_4cdec_2sa_3_sa_6Phrase_21__cmp__(PyObject *__pyx_v_self, PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cmp__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":107 - * return chunk - * - * def __cmp__(self, other): # <<<<<<<<<<<<<< - * cdef Phrase otherp - * cdef int i - */ - #if PY_MAJOR_VERSION < 3 static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_other) { struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_otherp = 0; int __pyx_v_i; int __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; + int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cmp__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":110 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":110 * cdef Phrase otherp * cdef int i * otherp = other # <<<<<<<<<<<<<< @@ -27160,37 +28714,39 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_ * if self.syms[i] < otherp.syms[i]: */ if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_other); - __pyx_v_otherp = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_other); + __pyx_t_1 = __pyx_v_other; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_otherp = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":111 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":111 * cdef int i * otherp = other * for i from 0 <= i < min(self.n, otherp.n): # <<<<<<<<<<<<<< * if self.syms[i] < otherp.syms[i]: * return -1 */ - __pyx_t_1 = __pyx_v_otherp->n; - __pyx_t_2 = __pyx_v_self->n; - if (((__pyx_t_1 < __pyx_t_2) != 0)) { - __pyx_t_3 = __pyx_t_1; + __pyx_t_2 = __pyx_v_otherp->n; + __pyx_t_3 = __pyx_v_self->n; + if (((__pyx_t_2 < __pyx_t_3) != 0)) { + __pyx_t_4 = __pyx_t_2; } else { - __pyx_t_3 = __pyx_t_2; + __pyx_t_4 = __pyx_t_3; } - __pyx_t_1 = __pyx_t_3; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + __pyx_t_2 = __pyx_t_4; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":112 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":112 * otherp = other * for i from 0 <= i < min(self.n, otherp.n): * if self.syms[i] < otherp.syms[i]: # <<<<<<<<<<<<<< * return -1 * elif self.syms[i] > otherp.syms[i]: */ - __pyx_t_4 = (((__pyx_v_self->syms[__pyx_v_i]) < (__pyx_v_otherp->syms[__pyx_v_i])) != 0); - if (__pyx_t_4) { + __pyx_t_5 = (((__pyx_v_self->syms[__pyx_v_i]) < (__pyx_v_otherp->syms[__pyx_v_i])) != 0); + if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":113 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":113 * for i from 0 <= i < min(self.n, otherp.n): * if self.syms[i] < otherp.syms[i]: * return -1 # <<<<<<<<<<<<<< @@ -27199,20 +28755,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_ */ __pyx_r = -1; goto __pyx_L0; - goto __pyx_L5; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":114 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":114 * if self.syms[i] < otherp.syms[i]: * return -1 * elif self.syms[i] > otherp.syms[i]: # <<<<<<<<<<<<<< * return 1 * if self.n < otherp.n: */ - __pyx_t_4 = (((__pyx_v_self->syms[__pyx_v_i]) > (__pyx_v_otherp->syms[__pyx_v_i])) != 0); - if (__pyx_t_4) { + __pyx_t_5 = (((__pyx_v_self->syms[__pyx_v_i]) > (__pyx_v_otherp->syms[__pyx_v_i])) != 0); + if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":115 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":115 * return -1 * elif self.syms[i] > otherp.syms[i]: * return 1 # <<<<<<<<<<<<<< @@ -27221,22 +28776,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_ */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L5; } - __pyx_L5:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":116 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":116 * elif self.syms[i] > otherp.syms[i]: * return 1 * if self.n < otherp.n: # <<<<<<<<<<<<<< * return -1 * elif self.n > otherp.n: */ - __pyx_t_4 = ((__pyx_v_self->n < __pyx_v_otherp->n) != 0); - if (__pyx_t_4) { + __pyx_t_5 = ((__pyx_v_self->n < __pyx_v_otherp->n) != 0); + if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":117 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":117 * return 1 * if self.n < otherp.n: * return -1 # <<<<<<<<<<<<<< @@ -27245,20 +28798,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_ */ __pyx_r = -1; goto __pyx_L0; - goto __pyx_L6; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":118 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":118 * if self.n < otherp.n: * return -1 * elif self.n > otherp.n: # <<<<<<<<<<<<<< * return 1 * else: */ - __pyx_t_4 = ((__pyx_v_self->n > __pyx_v_otherp->n) != 0); - if (__pyx_t_4) { + __pyx_t_5 = ((__pyx_v_self->n > __pyx_v_otherp->n) != 0); + if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":119 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":119 * return -1 * elif self.n > otherp.n: * return 1 # <<<<<<<<<<<<<< @@ -27267,11 +28819,10 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_ */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L6; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":121 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":121 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -27281,11 +28832,18 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_ __pyx_r = 0; goto __pyx_L0; } - __pyx_L6:; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":107 + * return chunk + * + * def __cmp__(self, other): # <<<<<<<<<<<<<< + * cdef Phrase otherp + * cdef int i + */ + + /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.Phrase.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -27295,6 +28853,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_ } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":123 + * return 0 + * + * def __hash__(self): # <<<<<<<<<<<<<< + * cdef int i + * cdef unsigned h + */ + /* Python wrapper */ static Py_hash_t __pyx_pw_4cdec_2sa_3_sa_6Phrase_23__hash__(PyObject *__pyx_v_self); /*proto*/ static Py_hash_t __pyx_pw_4cdec_2sa_3_sa_6Phrase_23__hash__(PyObject *__pyx_v_self) { @@ -27302,18 +28868,12 @@ static Py_hash_t __pyx_pw_4cdec_2sa_3_sa_6Phrase_23__hash__(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":123 - * return 0 - * - * def __hash__(self): # <<<<<<<<<<<<<< - * cdef int i - * cdef unsigned h - */ - static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self) { int __pyx_v_i; unsigned int __pyx_v_h; @@ -27323,7 +28883,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd int __pyx_t_2; __Pyx_RefNannySetupContext("__hash__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":126 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":126 * cdef int i * cdef unsigned h * h = 0 # <<<<<<<<<<<<<< @@ -27332,7 +28892,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd */ __pyx_v_h = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":127 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":127 * cdef unsigned h * h = 0 * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -27342,7 +28902,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd __pyx_t_1 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":128 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":128 * h = 0 * for i from 0 <= i < self.n: * if self.syms[i] > 0: # <<<<<<<<<<<<<< @@ -27352,7 +28912,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd __pyx_t_2 = (((__pyx_v_self->syms[__pyx_v_i]) > 0) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":129 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":129 * for i from 0 <= i < self.n: * if self.syms[i] > 0: * h = (h << 1) + self.syms[i] # <<<<<<<<<<<<<< @@ -27364,7 +28924,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":131 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":131 * h = (h << 1) + self.syms[i] * else: * h = (h << 1) + -self.syms[i] # <<<<<<<<<<<<<< @@ -27376,7 +28936,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd __pyx_L5:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":132 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":132 * else: * h = (h << 1) + -self.syms[i] * return h # <<<<<<<<<<<<<< @@ -27386,13 +28946,29 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd __pyx_r = __pyx_v_h; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":123 + * return 0 + * + * def __hash__(self): # <<<<<<<<<<<<<< + * cdef int i + * cdef unsigned h + */ + + /* function exit code */ __pyx_L0:; if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":134 + * return h + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + /* Python wrapper */ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_6Phrase_25__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_6Phrase_25__len__(PyObject *__pyx_v_self) { @@ -27400,24 +28976,18 @@ static Py_ssize_t __pyx_pw_4cdec_2sa_3_sa_6Phrase_25__len__(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_24__len__(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":134 - * return h - * - * def __len__(self): # <<<<<<<<<<<<<< - * return self.n - * - */ - static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_24__len__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":135 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":135 * * def __len__(self): * return self.n # <<<<<<<<<<<<<< @@ -27427,12 +28997,28 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_24__len__(struct __pyx_obj_4cd __pyx_r = __pyx_v_self->n; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":134 + * return h + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":137 + * return self.n + * + * def __getitem__(self, i): # <<<<<<<<<<<<<< + * return self.syms[i] + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -27440,18 +29026,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_27__getitem__(PyObject *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_26__getitem__(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":137 - * return self.n - * - * def __getitem__(self, i): # <<<<<<<<<<<<<< - * return self.syms[i] - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_26__getitem__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -27462,7 +29042,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_26__getitem__(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":138 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":138 * * def __getitem__(self, i): * return self.syms[i] # <<<<<<<<<<<<<< @@ -27471,14 +29051,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_26__getitem__(struct __pyx_obj_ */ __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 = 138; __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 = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->syms[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":137 + * return self.n + * + * def __getitem__(self, i): # <<<<<<<<<<<<<< + * return self.syms[i] + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.Phrase.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -27490,6 +29077,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_26__getitem__(struct __pyx_obj_ } static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_30generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":140 + * return self.syms[i] + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef int i + * for i from 0 <= i < self.n: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_29__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_29__iter__(PyObject *__pyx_v_self) { @@ -27497,18 +29092,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_29__iter__(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_28__iter__(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":140 - * return self.syms[i] - * - * def __iter__(self): # <<<<<<<<<<<<<< - * cdef int i - * for i from 0 <= i < self.n: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_28__iter__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self) { struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; @@ -27533,6 +29122,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_28__iter__(struct __pyx_obj_4cd return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -27566,7 +29156,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_30generator2(__pyx_GeneratorObj __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":142 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":142 * def __iter__(self): * cdef int i * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -27576,14 +29166,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_30generator2(__pyx_GeneratorObj __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":143 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":143 * cdef int i * for i from 0 <= i < self.n: * yield self.syms[i] # <<<<<<<<<<<<<< * * def subst(self, start, children): */ - __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 = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int((__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 = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -27597,6 +29187,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_30generator2(__pyx_GeneratorObj __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":140 + * return self.syms[i] + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef int i + * for i from 0 <= i < self.n: + */ + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -27610,6 +29210,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_30generator2(__pyx_GeneratorObj return NULL; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":145 + * yield self.syms[i] + * + * def subst(self, start, children): # <<<<<<<<<<<<<< + * cdef int i + * for i from 0 <= i < self.n: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -27622,7 +29230,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subst (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__children,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; @@ -27636,10 +29244,10 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__children)) != 0)) 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 = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -27665,18 +29273,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self), __pyx_v_start, __pyx_v_children); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":145 - * yield self.syms[i] - * - * def subst(self, start, children): # <<<<<<<<<<<<<< - * cdef int i - * for i from 0 <= i < self.n: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_children) { int __pyx_v_i; PyObject *__pyx_r = NULL; @@ -27692,7 +29294,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_ __Pyx_RefNannySetupContext("subst", 0); __Pyx_INCREF(__pyx_v_start); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":147 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":147 * def subst(self, start, children): * cdef int i * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -27702,7 +29304,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_ __pyx_t_1 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":148 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":148 * cdef int i * for i from 0 <= i < self.n: * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< @@ -27712,7 +29314,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_ __pyx_t_2 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":149 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":149 * for i from 0 <= i < self.n: * if sym_isvar(self.syms[i]): * start = start + children[sym_getindex(self.syms[i])-1] # <<<<<<<<<<<<<< @@ -27720,7 +29322,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_ * start = start + (self.syms[i],) */ __pyx_t_3 = (__pyx_f_4cdec_2sa_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, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_children, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 149; __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 = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); @@ -27731,30 +29333,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":151 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":151 * 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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_self->syms[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; __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 = 151; __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 = 151; __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 = 151; __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_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_5); __pyx_t_5 = 0; } __pyx_L5:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":152 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":152 * else: * start = start + (self.syms[i],) * return start # <<<<<<<<<<<<<< @@ -27766,8 +29368,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_ __pyx_r = __pyx_v_start; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":145 + * yield self.syms[i] + * + * def subst(self, start, children): # <<<<<<<<<<<<<< + * cdef int i + * for i from 0 <= i < self.n: + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -27780,6 +29389,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":155 + * + * property words: + * def __get__(self): # <<<<<<<<<<<<<< + * return [sym_tostring(w) for w in self if not sym_isvar(w)] + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_5words_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_5words_1__get__(PyObject *__pyx_v_self) { @@ -27787,18 +29404,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_5words_1__get__(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_5words___get__(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":155 - * - * property words: - * def __get__(self): # <<<<<<<<<<<<<< - * return [sym_tostring(w) for w in self if not sym_isvar(w)] - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_5words___get__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self) { PyObject *__pyx_v_w = NULL; PyObject *__pyx_r = NULL; @@ -27815,7 +29426,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_5words___get__(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":156 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":156 * property words: * def __get__(self): * return [sym_tostring(w) for w in self if not sym_isvar(w)] # <<<<<<<<<<<<<< @@ -27851,8 +29462,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_5words___get__(struct __pyx_obj } 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(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -27861,25 +29473,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_5words___get__(struct __pyx_obj } __Pyx_XDECREF_SET(__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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_6) != 0)) != 0); 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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5; } __pyx_L5:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = ((PyObject *)__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; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":155 + * + * property words: + * def __get__(self): # <<<<<<<<<<<<<< + * return [sym_tostring(w) for w in self if not sym_isvar(w)] + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -27893,6 +29512,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_5words___get__(struct __pyx_obj return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":160 + * cdef class Rule: + * + * def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): # <<<<<<<<<<<<<< + * if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) + * self.lhs = lhs + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -27908,16 +29535,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyOb __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}; + 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}; - - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":160 - * cdef class Rule: - * - * def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): # <<<<<<<<<<<<<< - * if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) - * self.lhs = lhs - */ values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { @@ -27935,26 +29554,26 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyOb kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lhs)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) 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 = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) 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 = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scores); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scores); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__word_alignments); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_word_alignments); if (value) { values[4] = value; kw_args--; } } } @@ -27972,7 +29591,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyOb 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 = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_lhs = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_lhs == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)values[1]); __pyx_v_e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)values[2]); __pyx_v_scores = values[3]; @@ -27989,6 +29608,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyOb if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_4cdec_2sa_3_sa_Phrase, 1, "f", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_4cdec_2sa_3_sa_Phrase, 1, "e", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self), __pyx_v_lhs, __pyx_v_f, __pyx_v_e, __pyx_v_scores, __pyx_v_word_alignments); + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; @@ -28008,7 +29629,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":161 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":161 * * def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): * if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) # <<<<<<<<<<<<<< @@ -28017,27 +29638,25 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_ */ __pyx_t_1 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_v_lhs) != 0)) != 0); if (__pyx_t_1) { - __pyx_t_2 = PyInt_FromLong(__pyx_v_lhs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_lhs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_70), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_LHS_symbol_d, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__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 = 161; __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)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__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 = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__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 = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":162 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":162 * def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): * if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) * self.lhs = lhs # <<<<<<<<<<<<<< @@ -28046,7 +29665,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_ */ __pyx_v_self->lhs = __pyx_v_lhs; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":163 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":163 * if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) * self.lhs = lhs * self.f = f # <<<<<<<<<<<<<< @@ -28059,7 +29678,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_ __Pyx_DECREF(((PyObject *)__pyx_v_self->f)); __pyx_v_self->f = __pyx_v_f; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":164 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":164 * self.lhs = lhs * self.f = f * self.e = e # <<<<<<<<<<<<<< @@ -28072,7 +29691,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_ __Pyx_DECREF(((PyObject *)__pyx_v_self->e)); __pyx_v_self->e = __pyx_v_e; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":165 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":165 * self.f = f * self.e = e * self.word_alignments = word_alignments # <<<<<<<<<<<<<< @@ -28085,7 +29704,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_ __Pyx_DECREF(__pyx_v_self->word_alignments); __pyx_v_self->word_alignments = __pyx_v_word_alignments; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":166 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":166 * self.e = e * self.word_alignments = word_alignments * self.scores = scores # <<<<<<<<<<<<<< @@ -28093,12 +29712,23 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_ * def __hash__(self): */ if (!(likely(((__pyx_v_scores) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_scores, __pyx_ptype_4cdec_2sa_3_sa_FeatureVector))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_scores); - __Pyx_GIVEREF(__pyx_v_scores); + __pyx_t_3 = __pyx_v_scores; + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->scores); __Pyx_DECREF(((PyObject *)__pyx_v_self->scores)); - __pyx_v_self->scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_v_scores); + __pyx_v_self->scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":160 + * cdef class Rule: + * + * def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): # <<<<<<<<<<<<<< + * if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) + * self.lhs = lhs + */ + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -28111,6 +29741,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":168 + * self.scores = scores + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return hash((self.lhs, self.f, self.e)) + * + */ + /* Python wrapper */ static Py_hash_t __pyx_pw_4cdec_2sa_3_sa_4Rule_3__hash__(PyObject *__pyx_v_self); /*proto*/ static Py_hash_t __pyx_pw_4cdec_2sa_3_sa_4Rule_3__hash__(PyObject *__pyx_v_self) { @@ -28118,18 +29756,12 @@ static Py_hash_t __pyx_pw_4cdec_2sa_3_sa_4Rule_3__hash__(PyObject *__pyx_v_self) __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule_2__hash__(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":168 - * self.scores = scores - * - * def __hash__(self): # <<<<<<<<<<<<<< - * return hash((self.lhs, self.f, self.e)) - * - */ - static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_4Rule_2__hash__(struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations @@ -28141,14 +29773,14 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_4Rule_2__hash__(struct __pyx_obj_4cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__hash__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":169 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":169 * * 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 = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __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 = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -28161,13 +29793,20 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_4Rule_2__hash__(struct __pyx_obj_4cdec_ 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 = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_t_3 = PyObject_Hash(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; goto __pyx_L0; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":168 + * self.scores = scores + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return hash((self.lhs, self.f, self.e)) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -28179,6 +29818,14 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_4Rule_2__hash__(struct __pyx_obj_4cdec_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":171 + * return hash((self.lhs, self.f, self.e)) + * + * 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)) + */ + /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static int __pyx_pw_4cdec_2sa_3_sa_4Rule_5__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ @@ -28191,6 +29838,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_5__cmp__(PyObject *__pyx_v_self, PyObje __Pyx_RefNannySetupContext("__cmp__ (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_4cdec_2sa_3_sa_Rule, 1, "other", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self), ((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_other)); + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; @@ -28200,14 +29849,6 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_5__cmp__(PyObject *__pyx_v_self, PyObje } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":171 - * return hash((self.lhs, self.f, self.e)) - * - * 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)) - */ - #if PY_MAJOR_VERSION < 3 static int __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self, struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_other) { int __pyx_r; @@ -28221,14 +29862,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(struct __pyx_obj_4cdec_2sa_3_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cmp__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":172 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":172 * * 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)) * */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __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 = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -28245,14 +29886,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(struct __pyx_obj_4cdec_2sa_3_s __Pyx_GIVEREF(__pyx_v_self->word_alignments); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":173 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":173 * 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 fmerge(self, Phrase f): */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_other->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_other->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __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 = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -28268,24 +29909,39 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(struct __pyx_obj_4cdec_2sa_3_s PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->word_alignments); __Pyx_GIVEREF(__pyx_v_self->word_alignments); __pyx_t_1 = 0; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":172 + * + * 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)) + * + */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __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)); - PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__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 = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_cmp, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __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 = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; goto __pyx_L0; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":171 + * return hash((self.lhs, self.f, self.e)) + * + * 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)) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -28298,6 +29954,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(struct __pyx_obj_4cdec_2sa_3_s } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":175 + * (other.lhs, other.f, other.e, self.word_alignments)) + * + * def fmerge(self, Phrase f): # <<<<<<<<<<<<<< + * if self.f == f: + * self.f = f + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_7fmerge(PyObject *__pyx_v_self, PyObject *__pyx_v_f); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_7fmerge(PyObject *__pyx_v_self, PyObject *__pyx_v_f) { @@ -28309,6 +29973,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_7fmerge(PyObject *__pyx_v_self, P __Pyx_RefNannySetupContext("fmerge (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_4cdec_2sa_3_sa_Phrase, 1, "f", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule_6fmerge(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self), ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_f)); + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -28317,14 +29983,6 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_7fmerge(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":175 - * (other.lhs, other.f, other.e, self.word_alignments)) - * - * def fmerge(self, Phrase f): # <<<<<<<<<<<<<< - * if self.f == f: - * self.f = f - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_6fmerge(struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self, struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -28335,7 +29993,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_6fmerge(struct __pyx_obj_4cdec_2s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fmerge", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":176 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":176 * * def fmerge(self, Phrase f): * if self.f == f: # <<<<<<<<<<<<<< @@ -28347,7 +30005,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_6fmerge(struct __pyx_obj_4cdec_2s __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":177 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":177 * def fmerge(self, Phrase f): * if self.f == f: * self.f = f # <<<<<<<<<<<<<< @@ -28363,6 +30021,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_6fmerge(struct __pyx_obj_4cdec_2s } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":175 + * (other.lhs, other.f, other.e, self.word_alignments)) + * + * def fmerge(self, Phrase f): # <<<<<<<<<<<<<< + * if self.f == f: + * self.f = f + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -28375,6 +30042,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_6fmerge(struct __pyx_obj_4cdec_2s return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":179 + * self.f = f + * + * def arity(self): # <<<<<<<<<<<<<< + * return self.f.arity() + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_9arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_9arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { @@ -28382,18 +30057,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_9arity(PyObject *__pyx_v_self, CY __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arity (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule_8arity(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":179 - * self.f = f - * - * def arity(self): # <<<<<<<<<<<<<< - * return self.f.arity() - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_8arity(struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -28404,7 +30073,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_8arity(struct __pyx_obj_4cdec_2sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arity", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":180 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":180 * * def arity(self): * return self.f.arity() # <<<<<<<<<<<<<< @@ -28412,17 +30081,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_8arity(struct __pyx_obj_4cdec_2sa * def __str__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->f), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->f), __pyx_n_s_arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __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 = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __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; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":179 + * self.f = f + * + * def arity(self): # <<<<<<<<<<<<<< + * return self.f.arity() + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -28434,6 +30110,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_8arity(struct __pyx_obj_4cdec_2sa return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":182 + * return self.f.arity() + * + * def __str__(self): # <<<<<<<<<<<<<< + * cdef unsigned i + * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_11__str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_11__str__(PyObject *__pyx_v_self) { @@ -28441,12 +30125,14 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_11__str__(PyObject *__pyx_v_self) __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":186 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":186 * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] * if self.word_alignments is not None: * fields.append(' '.join('%d-%d' % a for a in self.alignments())) # <<<<<<<<<<<<<< @@ -28478,6 +30164,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_7__str___genexpr(PyObject *__pyx_ return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -28513,9 +30200,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self), __pyx_n_s__alignments); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self), __pyx_n_s_alignments); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { @@ -28545,8 +30232,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -28557,9 +30245,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_a, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_71), __pyx_cur_scope->__pyx_v_a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_r = ((PyObject *)__pyx_t_2); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_d_d_2, __pyx_cur_scope->__pyx_v_a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; @@ -28579,6 +30267,8 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -28593,7 +30283,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":182 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":182 * return self.f.arity() * * def __str__(self): # <<<<<<<<<<<<<< @@ -28628,7 +30318,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":184 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":184 * def __str__(self): * cdef unsigned i * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] # <<<<<<<<<<<<<< @@ -28636,35 +30326,35 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_ * fields.append(' '.join('%d-%d' % a for a in self.alignments())) */ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_cur_scope->__pyx_v_self->lhs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->f)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_self->f)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->f)); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __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 = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->e)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_self->e)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->e)); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->scores)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_self->scores)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->scores)); - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_4); @@ -28678,7 +30368,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_ __pyx_v_fields = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":185 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":185 * cdef unsigned i * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] * if self.word_alignments is not None: # <<<<<<<<<<<<<< @@ -28689,33 +30379,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_ __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":186 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":186 * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] * if self.word_alignments is not None: * fields.append(' '.join('%d-%d' % a for a in self.alignments())) # <<<<<<<<<<<<<< * return ' ||| '.join(fields) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_4Rule_7__str___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_pf_4cdec_2sa_3_sa_4Rule_7__str___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __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 = 186; __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_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__46, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_5); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L3; } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":187 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":187 * if self.word_alignments is not None: * fields.append(' '.join('%d-%d' % a for a in self.alignments())) * return ' ||| '.join(fields) # <<<<<<<<<<<<<< @@ -28723,23 +30405,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_ * def alignments(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_19), __pyx_n_s__join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__10, __pyx_v_fields); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __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 = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_v_fields)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_fields)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_fields)); - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":182 + * return self.f.arity() + * + * def __str__(self): # <<<<<<<<<<<<<< + * cdef unsigned i + * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -28757,6 +30437,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_ } static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":189 + * return ' ||| '.join(fields) + * + * def alignments(self): # <<<<<<<<<<<<<< + * for point in self.word_alignments: + * yield point / ALIGNMENT_CODE, point % ALIGNMENT_CODE + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_13alignments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_13alignments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { @@ -28764,18 +30452,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_13alignments(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("alignments (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule_12alignments(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":189 - * return ' ||| '.join(fields) - * - * def alignments(self): # <<<<<<<<<<<<<< - * for point in self.word_alignments: - * yield point / ALIGNMENT_CODE, point % ALIGNMENT_CODE - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_12alignments(struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self) { struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *__pyx_cur_scope; PyObject *__pyx_r = NULL; @@ -28800,6 +30482,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_12alignments(struct __pyx_obj_4cd return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -28837,7 +30520,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":190 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":190 * * def alignments(self): * for point in self.word_alignments: # <<<<<<<<<<<<<< @@ -28869,8 +30552,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -28882,17 +30566,17 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rule.pxi":191 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":191 * def alignments(self): * for point in self.word_alignments: * yield point / ALIGNMENT_CODE, point % ALIGNMENT_CODE # <<<<<<<<<<<<<< */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_cur_scope->__pyx_v_point, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Remainder(__pyx_cur_scope->__pyx_v_point, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); @@ -28905,7 +30589,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec __Pyx_GIVEREF(__pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; - __pyx_r = ((PyObject *)__pyx_t_4); + __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; @@ -28925,6 +30609,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rule.pxi":189 + * return ' ||| '.join(fields) + * + * def alignments(self): # <<<<<<<<<<<<<< + * for point in self.word_alignments: + * yield point / ALIGNMENT_CODE, point % ALIGNMENT_CODE + */ + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -28941,6 +30635,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec return NULL; } +/* "cdec/sa/_sa.pxd":37 + * cdef class Rule: + * cdef int lhs + * cdef readonly Phrase f, e # <<<<<<<<<<<<<< + * cdef FeatureVector scores + * cdef int n_scores + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_1f_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_1f_1__get__(PyObject *__pyx_v_self) { @@ -28948,18 +30650,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_1f_1__get__(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule_1f___get__(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "cdec/sa/_sa.pxd":37 - * cdef class Rule: - * cdef int lhs - * cdef readonly Phrase f, e # <<<<<<<<<<<<<< - * cdef FeatureVector scores - * cdef int n_scores - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_1f___get__(struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -28969,7 +30665,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_1f___get__(struct __pyx_obj_4cdec __pyx_r = ((PyObject *)__pyx_v_self->f); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -28983,6 +30679,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_1e_1__get__(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule_1e___get__(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -28996,14 +30694,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_1e___get__(struct __pyx_obj_4cdec __pyx_r = ((PyObject *)__pyx_v_self->e); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":21 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":21 * int arr_len * * cdef _Trie_Node* new_trie_node(): # <<<<<<<<<<<<<< @@ -29017,7 +30715,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_trie_node", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":23 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":23 * cdef _Trie_Node* new_trie_node(): * cdef _Trie_Node* node * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) # <<<<<<<<<<<<<< @@ -29026,7 +30724,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie */ __pyx_v_node = ((struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *)malloc((sizeof(struct __pyx_t_4cdec_2sa_3_sa__Trie_Node)))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":24 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":24 * cdef _Trie_Node* node * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) * node.root = NULL # <<<<<<<<<<<<<< @@ -29035,7 +30733,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie */ __pyx_v_node->root = NULL; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":25 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":25 * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) * node.root = NULL * node.arr_len = 0 # <<<<<<<<<<<<<< @@ -29044,7 +30742,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie */ __pyx_v_node->arr_len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":26 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":26 * node.root = NULL * node.arr_len = 0 * node.arr = malloc(sizeof(0*sizeof(int))) # <<<<<<<<<<<<<< @@ -29053,7 +30751,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie */ __pyx_v_node->arr = ((int *)malloc((sizeof((0 * (sizeof(int))))))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":27 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":27 * node.arr_len = 0 * node.arr = malloc(sizeof(0*sizeof(int))) * return node # <<<<<<<<<<<<<< @@ -29063,13 +30761,21 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie __pyx_r = __pyx_v_node; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":21 + * int arr_len + * + * cdef _Trie_Node* new_trie_node(): # <<<<<<<<<<<<<< + * cdef _Trie_Node* node + * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":29 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":29 * return node * * cdef _Trie_Edge* new_trie_edge(int val): # <<<<<<<<<<<<<< @@ -29083,7 +30789,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_trie_edge", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":31 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":31 * cdef _Trie_Edge* new_trie_edge(int val): * cdef _Trie_Edge* edge * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) # <<<<<<<<<<<<<< @@ -29092,7 +30798,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie */ __pyx_v_edge = ((struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *)malloc((sizeof(struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge)))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":32 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":32 * cdef _Trie_Edge* edge * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) * edge.node = new_trie_node() # <<<<<<<<<<<<<< @@ -29101,7 +30807,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie */ __pyx_v_edge->node = __pyx_f_4cdec_2sa_3_sa_new_trie_node(); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":33 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":33 * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) * edge.node = new_trie_node() * edge.bigger = NULL # <<<<<<<<<<<<<< @@ -29110,7 +30816,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie */ __pyx_v_edge->bigger = NULL; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":34 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":34 * edge.node = new_trie_node() * edge.bigger = NULL * edge.smaller = NULL # <<<<<<<<<<<<<< @@ -29119,7 +30825,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie */ __pyx_v_edge->smaller = NULL; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":35 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":35 * edge.bigger = NULL * edge.smaller = NULL * edge.val = val # <<<<<<<<<<<<<< @@ -29128,7 +30834,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie */ __pyx_v_edge->val = __pyx_v_val; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":36 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":36 * edge.smaller = NULL * edge.val = val * return edge # <<<<<<<<<<<<<< @@ -29138,13 +30844,21 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie __pyx_r = __pyx_v_edge; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":29 + * return node + * + * cdef _Trie_Edge* new_trie_edge(int val): # <<<<<<<<<<<<<< + * cdef _Trie_Edge* edge + * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":38 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":38 * return edge * * cdef free_trie_node(_Trie_Node* node): # <<<<<<<<<<<<<< @@ -29162,7 +30876,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_node(struct __pyx_t_4cdec_2sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("free_trie_node", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":39 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":39 * * cdef free_trie_node(_Trie_Node* node): * if node != NULL: # <<<<<<<<<<<<<< @@ -29172,7 +30886,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_node(struct __pyx_t_4cdec_2sa_ __pyx_t_1 = ((__pyx_v_node != NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":40 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":40 * cdef free_trie_node(_Trie_Node* node): * if node != NULL: * free_trie_edge(node.root) # <<<<<<<<<<<<<< @@ -29183,7 +30897,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_node(struct __pyx_t_4cdec_2sa_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":41 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":41 * if node != NULL: * free_trie_edge(node.root) * free(node.arr) # <<<<<<<<<<<<<< @@ -29195,6 +30909,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_node(struct __pyx_t_4cdec_2sa_ } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":38 + * return edge + * + * cdef free_trie_node(_Trie_Node* node): # <<<<<<<<<<<<<< + * if node != NULL: + * free_trie_edge(node.root) + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -29207,7 +30930,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_node(struct __pyx_t_4cdec_2sa_ return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":43 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":43 * free(node.arr) * * cdef free_trie_edge(_Trie_Edge* edge): # <<<<<<<<<<<<<< @@ -29225,7 +30948,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("free_trie_edge", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":44 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":44 * * cdef free_trie_edge(_Trie_Edge* edge): * if edge != NULL: # <<<<<<<<<<<<<< @@ -29235,7 +30958,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_ __pyx_t_1 = ((__pyx_v_edge != NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":45 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":45 * cdef free_trie_edge(_Trie_Edge* edge): * if edge != NULL: * free_trie_node(edge.node) # <<<<<<<<<<<<<< @@ -29246,7 +30969,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":46 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":46 * if edge != NULL: * free_trie_node(edge.node) * free_trie_edge(edge.bigger) # <<<<<<<<<<<<<< @@ -29257,7 +30980,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":47 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":47 * free_trie_node(edge.node) * free_trie_edge(edge.bigger) * free_trie_edge(edge.smaller) # <<<<<<<<<<<<<< @@ -29271,6 +30994,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_ } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":43 + * free(node.arr) + * + * cdef free_trie_edge(_Trie_Edge* edge): # <<<<<<<<<<<<<< + * if edge != NULL: + * free_trie_node(edge.node) + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -29283,7 +31015,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_ return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":49 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":49 * free_trie_edge(edge.smaller) * * cdef _Trie_Node* trie_find(_Trie_Node* node, int val): # <<<<<<<<<<<<<< @@ -29301,7 +31033,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin int __pyx_t_4; __Pyx_RefNannySetupContext("trie_find", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":51 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":51 * cdef _Trie_Node* trie_find(_Trie_Node* node, int val): * cdef _Trie_Edge* cur * cur = node.root # <<<<<<<<<<<<<< @@ -29311,7 +31043,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin __pyx_t_1 = __pyx_v_node->root; __pyx_v_cur = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":52 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":52 * cdef _Trie_Edge* cur * cur = node.root * while cur != NULL and cur.val != val: # <<<<<<<<<<<<<< @@ -29328,7 +31060,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin } if (!__pyx_t_4) break; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":53 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":53 * cur = node.root * while cur != NULL and cur.val != val: * if val > cur.val: # <<<<<<<<<<<<<< @@ -29338,7 +31070,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin __pyx_t_4 = ((__pyx_v_val > __pyx_v_cur->val) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":54 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":54 * while cur != NULL and cur.val != val: * if val > cur.val: * cur = cur.bigger # <<<<<<<<<<<<<< @@ -29350,7 +31082,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin goto __pyx_L5; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":55 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":55 * if val > cur.val: * cur = cur.bigger * elif val < cur.val: # <<<<<<<<<<<<<< @@ -29360,7 +31092,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin __pyx_t_4 = ((__pyx_v_val < __pyx_v_cur->val) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":56 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":56 * cur = cur.bigger * elif val < cur.val: * cur = cur.smaller # <<<<<<<<<<<<<< @@ -29374,7 +31106,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin __pyx_L5:; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":57 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":57 * elif val < cur.val: * cur = cur.smaller * if cur == NULL: # <<<<<<<<<<<<<< @@ -29384,7 +31116,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin __pyx_t_4 = ((__pyx_v_cur == NULL) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":58 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":58 * cur = cur.smaller * if cur == NULL: * return NULL # <<<<<<<<<<<<<< @@ -29393,11 +31125,10 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin */ __pyx_r = NULL; goto __pyx_L0; - goto __pyx_L6; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":60 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":60 * return NULL * else: * return cur.node # <<<<<<<<<<<<<< @@ -29407,15 +31138,22 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin __pyx_r = __pyx_v_cur->node; goto __pyx_L0; } - __pyx_L6:; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":49 + * free_trie_edge(edge.smaller) + * + * cdef _Trie_Node* trie_find(_Trie_Node* node, int val): # <<<<<<<<<<<<<< + * cdef _Trie_Edge* cur + * cur = node.root + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":62 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":62 * return cur.node * * cdef trie_node_data_append(_Trie_Node* node, int val): # <<<<<<<<<<<<<< @@ -29429,7 +31167,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trie_node_data_append", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":64 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":64 * cdef trie_node_data_append(_Trie_Node* node, int val): * cdef int new_len * new_len = node.arr_len + 1 # <<<<<<<<<<<<<< @@ -29438,7 +31176,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd */ __pyx_v_new_len = (__pyx_v_node->arr_len + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":65 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":65 * cdef int new_len * new_len = node.arr_len + 1 * node.arr = realloc(node.arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -29447,7 +31185,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd */ __pyx_v_node->arr = ((int *)realloc(__pyx_v_node->arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":66 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":66 * new_len = node.arr_len + 1 * node.arr = realloc(node.arr, new_len*sizeof(int)) * node.arr[node.arr_len] = val # <<<<<<<<<<<<<< @@ -29456,7 +31194,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd */ (__pyx_v_node->arr[__pyx_v_node->arr_len]) = __pyx_v_val; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":67 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":67 * node.arr = realloc(node.arr, new_len*sizeof(int)) * node.arr[node.arr_len] = val * node.arr_len = new_len # <<<<<<<<<<<<<< @@ -29465,13 +31203,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd */ __pyx_v_node->arr_len = __pyx_v_new_len; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":62 + * return cur.node + * + * cdef trie_node_data_append(_Trie_Node* node, int val): # <<<<<<<<<<<<<< + * cdef int new_len + * new_len = node.arr_len + 1 + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":69 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":69 * node.arr_len = new_len * * cdef trie_node_data_extend(_Trie_Node* node, int* vals, int num_vals): # <<<<<<<<<<<<<< @@ -29485,7 +31232,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trie_node_data_extend", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":71 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":71 * cdef trie_node_data_extend(_Trie_Node* node, int* vals, int num_vals): * cdef int new_len * new_len = node.arr_len + num_vals # <<<<<<<<<<<<<< @@ -29494,7 +31241,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd */ __pyx_v_new_len = (__pyx_v_node->arr_len + __pyx_v_num_vals); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":72 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":72 * cdef int new_len * new_len = node.arr_len + num_vals * node.arr = realloc(node.arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -29503,7 +31250,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd */ __pyx_v_node->arr = ((int *)realloc(__pyx_v_node->arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":73 * new_len = node.arr_len + num_vals * node.arr = realloc(node.arr, new_len*sizeof(int)) * memcpy(node.arr + node.arr_len, vals, num_vals*sizeof(int)) # <<<<<<<<<<<<<< @@ -29512,7 +31259,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd */ memcpy((__pyx_v_node->arr + __pyx_v_node->arr_len), __pyx_v_vals, (__pyx_v_num_vals * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":74 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":74 * node.arr = realloc(node.arr, new_len*sizeof(int)) * memcpy(node.arr + node.arr_len, vals, num_vals*sizeof(int)) * node.arr_len = new_len # <<<<<<<<<<<<<< @@ -29521,13 +31268,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd */ __pyx_v_node->arr_len = __pyx_v_new_len; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":69 + * node.arr_len = new_len + * + * cdef trie_node_data_extend(_Trie_Node* node, int* vals, int num_vals): # <<<<<<<<<<<<<< + * cdef int new_len + * new_len = node.arr_len + num_vals + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":77 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":77 * * * cdef _Trie_Node* trie_insert(_Trie_Node* node, int val): # <<<<<<<<<<<<<< @@ -29544,7 +31300,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins int __pyx_t_3; __Pyx_RefNannySetupContext("trie_insert", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":79 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":79 * cdef _Trie_Node* trie_insert(_Trie_Node* node, int val): * cdef _Trie_Edge** cur * cur = &node.root # <<<<<<<<<<<<<< @@ -29553,7 +31309,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins */ __pyx_v_cur = (&__pyx_v_node->root); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":80 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":80 * cdef _Trie_Edge** cur * cur = &node.root * while cur[0] != NULL and cur[0].val != val: # <<<<<<<<<<<<<< @@ -29570,7 +31326,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins } if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":81 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":81 * cur = &node.root * while cur[0] != NULL and cur[0].val != val: * if val > cur[0].val: # <<<<<<<<<<<<<< @@ -29580,7 +31336,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins __pyx_t_3 = ((__pyx_v_val > (__pyx_v_cur[0])->val) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":82 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":82 * while cur[0] != NULL and cur[0].val != val: * if val > cur[0].val: * cur = &cur[0].bigger # <<<<<<<<<<<<<< @@ -29591,7 +31347,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins goto __pyx_L5; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":83 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":83 * if val > cur[0].val: * cur = &cur[0].bigger * elif val < cur[0].val: # <<<<<<<<<<<<<< @@ -29601,7 +31357,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins __pyx_t_3 = ((__pyx_v_val < (__pyx_v_cur[0])->val) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":84 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":84 * cur = &cur[0].bigger * elif val < cur[0].val: * cur = &cur[0].smaller # <<<<<<<<<<<<<< @@ -29614,7 +31370,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins __pyx_L5:; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":85 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":85 * elif val < cur[0].val: * cur = &cur[0].smaller * if cur[0] == NULL: # <<<<<<<<<<<<<< @@ -29624,7 +31380,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins __pyx_t_3 = (((__pyx_v_cur[0]) == NULL) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":86 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":86 * cur = &cur[0].smaller * if cur[0] == NULL: * cur[0] = new_trie_edge(val) # <<<<<<<<<<<<<< @@ -29636,7 +31392,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":87 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":87 * if cur[0] == NULL: * cur[0] = new_trie_edge(val) * return cur[0].node # <<<<<<<<<<<<<< @@ -29646,13 +31402,21 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins __pyx_r = (__pyx_v_cur[0])->node; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":77 + * + * + * cdef _Trie_Node* trie_insert(_Trie_Node* node, int val): # <<<<<<<<<<<<<< + * cdef _Trie_Edge** cur + * cur = &node.root + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":89 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":89 * return cur[0].node * * cdef trie_node_to_map(_Trie_Node* node, result, prefix, int include_zeros): # <<<<<<<<<<<<<< @@ -29673,7 +31437,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("trie_node_to_map", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":92 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":92 * cdef IntList arr * * if include_zeros or node.arr_len > 0: # <<<<<<<<<<<<<< @@ -29688,19 +31452,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s } if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":93 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":93 * * if include_zeros or node.arr_len > 0: * arr = IntList() # <<<<<<<<<<<<<< * free(arr.arr) * arr.arr = malloc(node.arr_len * sizeof(int)) */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __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_GOTREF(__pyx_t_3); __pyx_v_arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":94 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":94 * if include_zeros or node.arr_len > 0: * arr = IntList() * free(arr.arr) # <<<<<<<<<<<<<< @@ -29709,7 +31473,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s */ free(__pyx_v_arr->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":95 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":95 * arr = IntList() * free(arr.arr) * arr.arr = malloc(node.arr_len * sizeof(int)) # <<<<<<<<<<<<<< @@ -29718,7 +31482,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s */ __pyx_v_arr->arr = ((int *)malloc((__pyx_v_node->arr_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":96 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":96 * free(arr.arr) * arr.arr = malloc(node.arr_len * sizeof(int)) * memcpy(arr.arr, node.arr, node.arr_len * sizeof(int)) # <<<<<<<<<<<<<< @@ -29727,7 +31491,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s */ memcpy(__pyx_v_arr->arr, __pyx_v_node->arr, (__pyx_v_node->arr_len * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":97 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":97 * arr.arr = malloc(node.arr_len * sizeof(int)) * memcpy(arr.arr, node.arr, node.arr_len * sizeof(int)) * arr.len = node.arr_len # <<<<<<<<<<<<<< @@ -29737,7 +31501,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s __pyx_t_4 = __pyx_v_node->arr_len; __pyx_v_arr->len = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":98 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":98 * memcpy(arr.arr, node.arr, node.arr_len * sizeof(int)) * arr.len = node.arr_len * arr.size = node.arr_len # <<<<<<<<<<<<<< @@ -29747,19 +31511,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s __pyx_t_4 = __pyx_v_node->arr_len; __pyx_v_arr->size = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":99 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":99 * arr.len = node.arr_len * arr.size = node.arr_len * result[prefix] = arr # <<<<<<<<<<<<<< * 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 (unlikely(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;} goto __pyx_L3; } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":100 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":100 * arr.size = node.arr_len * result[prefix] = arr * trie_edge_to_map(node.root, result, prefix, include_zeros) # <<<<<<<<<<<<<< @@ -29770,6 +31534,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":89 + * return cur[0].node + * + * cdef trie_node_to_map(_Trie_Node* node, result, prefix, int include_zeros): # <<<<<<<<<<<<<< + * cdef IntList arr + * + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -29783,7 +31556,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":102 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":102 * trie_edge_to_map(node.root, result, prefix, include_zeros) * * cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros): # <<<<<<<<<<<<<< @@ -29803,7 +31576,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s __Pyx_RefNannySetupContext("trie_edge_to_map", 0); __Pyx_INCREF(__pyx_v_prefix); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":103 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":103 * * cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros): * if edge != NULL: # <<<<<<<<<<<<<< @@ -29813,7 +31586,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s __pyx_t_1 = ((__pyx_v_edge != NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":104 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":104 * cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros): * if edge != NULL: * trie_edge_to_map(edge.smaller, result, prefix, include_zeros) # <<<<<<<<<<<<<< @@ -29824,7 +31597,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":105 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":105 * if edge != NULL: * trie_edge_to_map(edge.smaller, result, prefix, include_zeros) * trie_edge_to_map(edge.bigger, result, prefix, include_zeros) # <<<<<<<<<<<<<< @@ -29835,27 +31608,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":106 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":106 * trie_edge_to_map(edge.smaller, result, prefix, include_zeros) * trie_edge_to_map(edge.bigger, result, prefix, include_zeros) * prefix = prefix + (edge.val,) # <<<<<<<<<<<<<< * 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 = __Pyx_PyInt_From_int(__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_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_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, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __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_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":107 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":107 * trie_edge_to_map(edge.bigger, result, prefix, include_zeros) * prefix = prefix + (edge.val,) * trie_node_to_map(edge.node, result, prefix, include_zeros) # <<<<<<<<<<<<<< @@ -29869,6 +31642,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":102 + * trie_edge_to_map(node.root, result, prefix, include_zeros) + * + * cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros): # <<<<<<<<<<<<<< + * if edge != NULL: + * trie_edge_to_map(edge.smaller, result, prefix, include_zeros) + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -29883,6 +31665,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":114 + * cdef int V + * + * def __cinit__(self, int alphabet_size): # <<<<<<<<<<<<<< + * self.V = alphabet_size + * self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*)) + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -29894,7 +31684,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, P __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alphabet_size,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alphabet_size,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -29907,7 +31697,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, P kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alphabet_size)) != 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)) { @@ -29918,7 +31708,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, P } 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_As_int(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;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; @@ -29929,24 +31719,18 @@ static int __pyx_pw_4cdec_2sa_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, P return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7TrieMap___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_v_self), __pyx_v_alphabet_size); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":114 - * cdef int V - * - * def __cinit__(self, int alphabet_size): # <<<<<<<<<<<<<< - * self.V = alphabet_size - * self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*)) - */ - static int __pyx_pf_4cdec_2sa_3_sa_7TrieMap___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *__pyx_v_self, int __pyx_v_alphabet_size) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":115 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":115 * * def __cinit__(self, int alphabet_size): * self.V = alphabet_size # <<<<<<<<<<<<<< @@ -29955,7 +31739,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7TrieMap___cinit__(struct __pyx_obj_4cdec_2sa */ __pyx_v_self->V = __pyx_v_alphabet_size; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":116 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":116 * def __cinit__(self, int alphabet_size): * self.V = alphabet_size * self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*)) # <<<<<<<<<<<<<< @@ -29964,7 +31748,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7TrieMap___cinit__(struct __pyx_obj_4cdec_2sa */ __pyx_v_self->root = ((struct __pyx_t_4cdec_2sa_3_sa__Trie_Node **)malloc((__pyx_v_self->V * (sizeof(struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *))))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":117 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":117 * self.V = alphabet_size * self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*)) * memset(self.root, 0, self.V * sizeof(_Trie_Node*)) # <<<<<<<<<<<<<< @@ -29973,28 +31757,39 @@ static int __pyx_pf_4cdec_2sa_3_sa_7TrieMap___cinit__(struct __pyx_obj_4cdec_2sa */ memset(__pyx_v_self->root, 0, (__pyx_v_self->V * (sizeof(struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *)))); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":114 + * cdef int V + * + * def __cinit__(self, int alphabet_size): # <<<<<<<<<<<<<< + * self.V = alphabet_size + * self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*)) + */ + + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":120 + * + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * cdef int i + * for i from 0 <= i < self.V: + */ + /* Python wrapper */ static void __pyx_pw_4cdec_2sa_3_sa_7TrieMap_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4cdec_2sa_3_sa_7TrieMap_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":120 - * - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * cdef int i - * for i from 0 <= i < self.V: - */ - static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *__pyx_v_self) { int __pyx_v_i; __Pyx_RefNannyDeclarations @@ -30006,7 +31801,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":122 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":122 * def __dealloc__(self): * cdef int i * for i from 0 <= i < self.V: # <<<<<<<<<<<<<< @@ -30016,7 +31811,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec __pyx_t_1 = __pyx_v_self->V; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":123 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":123 * cdef int i * for i from 0 <= i < self.V: * if self.root[i] != NULL: # <<<<<<<<<<<<<< @@ -30026,7 +31821,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec __pyx_t_2 = (((__pyx_v_self->root[__pyx_v_i]) != NULL) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":124 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":124 * for i from 0 <= i < self.V: * if self.root[i] != NULL: * free_trie_node(self.root[i]) # <<<<<<<<<<<<<< @@ -30041,7 +31836,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec __pyx_L5:; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":125 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":125 * if self.root[i] != NULL: * free_trie_node(self.root[i]) * free(self.root) # <<<<<<<<<<<<<< @@ -30050,14 +31845,31 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec */ free(__pyx_v_self->root); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":120 + * + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * cdef int i + * for i from 0 <= i < self.V: + */ + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("cdec.sa._sa.TrieMap.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.TrieMap.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":128 + * + * + * def insert(self, pattern): # <<<<<<<<<<<<<< + * cdef int* p + * cdef int i, l + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7TrieMap_5insert(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7TrieMap_5insert(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { @@ -30065,18 +31877,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7TrieMap_5insert(PyObject *__pyx_v_self __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insert (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":128 - * - * - * def insert(self, pattern): # <<<<<<<<<<<<<< - * cdef int* p - * cdef int i, l - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_pattern) { int *__pyx_v_p; int __pyx_v_i; @@ -30092,7 +31898,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insert", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":131 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":131 * cdef int* p * cdef int i, l * l = len(pattern) # <<<<<<<<<<<<<< @@ -30102,7 +31908,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec __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_v_l = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":132 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":132 * cdef int i, l * l = len(pattern) * p = malloc(l*sizeof(int)) # <<<<<<<<<<<<<< @@ -30111,7 +31917,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec */ __pyx_v_p = ((int *)malloc((__pyx_v_l * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":133 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":133 * l = len(pattern) * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: # <<<<<<<<<<<<<< @@ -30121,21 +31927,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec __pyx_t_2 = __pyx_v_l; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":134 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":134 * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: * p[i] = pattern[i] # <<<<<<<<<<<<<< * self._insert(p,l) * free(p) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pattern, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); 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, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[11]; __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_As_int(__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_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_p[__pyx_v_i]) = __pyx_t_4; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":135 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":135 * for i from 0 <= i < l: * p[i] = pattern[i] * self._insert(p,l) # <<<<<<<<<<<<<< @@ -30144,7 +31950,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_insert(__pyx_v_self, __pyx_v_p, __pyx_v_l); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":136 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":136 * p[i] = pattern[i] * self._insert(p,l) * free(p) # <<<<<<<<<<<<<< @@ -30153,6 +31959,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec */ free(__pyx_v_p); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":128 + * + * + * def insert(self, pattern): # <<<<<<<<<<<<<< + * cdef int* p + * cdef int i, l + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -30165,7 +31980,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":139 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":139 * * * cdef _Trie_Node* _insert(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<< @@ -30182,7 +31997,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap int __pyx_t_2; __Pyx_RefNannySetupContext("_insert", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":142 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":142 * cdef int i * cdef _Trie_Node* node * if self.root[pattern[0]] == NULL: # <<<<<<<<<<<<<< @@ -30192,7 +32007,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap __pyx_t_1 = (((__pyx_v_self->root[(__pyx_v_pattern[0])]) == NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":143 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":143 * cdef _Trie_Node* node * if self.root[pattern[0]] == NULL: * self.root[pattern[0]] = new_trie_node() # <<<<<<<<<<<<<< @@ -30204,7 +32019,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":144 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":144 * if self.root[pattern[0]] == NULL: * self.root[pattern[0]] = new_trie_node() * node = self.root[pattern[0]] # <<<<<<<<<<<<<< @@ -30213,7 +32028,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap */ __pyx_v_node = (__pyx_v_self->root[(__pyx_v_pattern[0])]); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":145 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":145 * self.root[pattern[0]] = new_trie_node() * node = self.root[pattern[0]] * for i from 1 <= i < pattern_len: # <<<<<<<<<<<<<< @@ -30223,7 +32038,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap __pyx_t_2 = __pyx_v_pattern_len; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":146 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":146 * node = self.root[pattern[0]] * for i from 1 <= i < pattern_len: * node = trie_insert(node, pattern[i]) # <<<<<<<<<<<<<< @@ -30233,7 +32048,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap __pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i])); } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":147 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":147 * for i from 1 <= i < pattern_len: * node = trie_insert(node, pattern[i]) * return node # <<<<<<<<<<<<<< @@ -30243,12 +32058,28 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap __pyx_r = __pyx_v_node; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":139 + * + * + * cdef _Trie_Node* _insert(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<< + * cdef int i + * cdef _Trie_Node* node + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":149 + * return node + * + * def contains(self, pattern): # <<<<<<<<<<<<<< + * cdef int* p + * cdef int i, l + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7TrieMap_7contains(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7TrieMap_7contains(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { @@ -30256,18 +32087,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7TrieMap_7contains(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":149 - * return node - * - * def contains(self, pattern): # <<<<<<<<<<<<<< - * cdef int* p - * cdef int i, l - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_pattern) { int *__pyx_v_p; int __pyx_v_i; @@ -30285,7 +32110,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":153 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":153 * cdef int i, l * cdef _Trie_Node* node * l = len(pattern) # <<<<<<<<<<<<<< @@ -30295,7 +32120,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd __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_v_l = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":154 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":154 * cdef _Trie_Node* node * l = len(pattern) * p = malloc(l*sizeof(int)) # <<<<<<<<<<<<<< @@ -30304,7 +32129,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd */ __pyx_v_p = ((int *)malloc((__pyx_v_l * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":155 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":155 * l = len(pattern) * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: # <<<<<<<<<<<<<< @@ -30314,21 +32139,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd __pyx_t_2 = __pyx_v_l; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":156 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":156 * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: * p[i] = pattern[i] # <<<<<<<<<<<<<< * node = self._contains(p,l) * free(p) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pattern, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); 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, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[11]; __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_As_int(__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_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_p[__pyx_v_i]) = __pyx_t_4; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":157 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":157 * for i from 0 <= i < l: * p[i] = pattern[i] * node = self._contains(p,l) # <<<<<<<<<<<<<< @@ -30337,7 +32162,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd */ __pyx_v_node = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_contains(__pyx_v_self, __pyx_v_p, __pyx_v_l); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":158 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":158 * p[i] = pattern[i] * node = self._contains(p,l) * free(p) # <<<<<<<<<<<<<< @@ -30346,7 +32171,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd */ free(__pyx_v_p); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":159 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":159 * node = self._contains(p,l) * free(p) * if node == NULL: # <<<<<<<<<<<<<< @@ -30356,7 +32181,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd __pyx_t_5 = ((__pyx_v_node == NULL) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":160 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":160 * free(p) * if node == NULL: * return False # <<<<<<<<<<<<<< @@ -30364,16 +32189,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd * 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_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - goto __pyx_L5; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":162 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":162 * return False * else: * return True # <<<<<<<<<<<<<< @@ -30381,16 +32203,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd * 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_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; goto __pyx_L0; } - __pyx_L5:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":149 + * return node + * + * def contains(self, pattern): # <<<<<<<<<<<<<< + * cdef int* p + * cdef int i, l + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cdec.sa._sa.TrieMap.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -30401,7 +32227,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":164 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":164 * return True * * cdef _Trie_Node* _contains(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<< @@ -30419,7 +32245,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap int __pyx_t_3; __Pyx_RefNannySetupContext("_contains", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":167 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":167 * cdef int i * cdef _Trie_Node* node * node = self.root[pattern[0]] # <<<<<<<<<<<<<< @@ -30428,7 +32254,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap */ __pyx_v_node = (__pyx_v_self->root[(__pyx_v_pattern[0])]); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":168 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":168 * cdef _Trie_Node* node * node = self.root[pattern[0]] * i = 1 # <<<<<<<<<<<<<< @@ -30437,7 +32263,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":169 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":169 * node = self.root[pattern[0]] * i = 1 * while node != NULL and i < pattern_len: # <<<<<<<<<<<<<< @@ -30454,7 +32280,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap } if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":170 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":170 * i = 1 * while node != NULL and i < pattern_len: * node = trie_find(node, pattern[i]) # <<<<<<<<<<<<<< @@ -30463,7 +32289,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap */ __pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_find(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i])); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":171 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":171 * while node != NULL and i < pattern_len: * node = trie_find(node, pattern[i]) * i = i+1 # <<<<<<<<<<<<<< @@ -30473,7 +32299,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap __pyx_v_i = (__pyx_v_i + 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":172 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":172 * node = trie_find(node, pattern[i]) * i = i+1 * return node # <<<<<<<<<<<<<< @@ -30483,12 +32309,28 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap __pyx_r = __pyx_v_node; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":164 + * return True + * + * cdef _Trie_Node* _contains(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<< + * cdef int i + * cdef _Trie_Node* node + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":174 + * return node + * + * def toMap(self, flag): # <<<<<<<<<<<<<< + * cdef int i, include_zeros + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, PyObject *__pyx_v_flag) { @@ -30496,18 +32338,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toMap (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_v_self), ((PyObject *)__pyx_v_flag)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":174 - * return node - * - * def toMap(self, flag): # <<<<<<<<<<<<<< - * cdef int i, include_zeros - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_flag) { int __pyx_v_i; int __pyx_v_include_zeros; @@ -30523,7 +32359,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toMap", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":177 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":177 * cdef int i, include_zeros * * if flag: # <<<<<<<<<<<<<< @@ -30533,7 +32369,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_ __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;} if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":178 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":178 * * if flag: * include_zeros=1 # <<<<<<<<<<<<<< @@ -30545,7 +32381,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":180 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":180 * include_zeros=1 * else: * include_zeros=0 # <<<<<<<<<<<<<< @@ -30556,7 +32392,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_ } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":181 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":181 * else: * include_zeros=0 * result = {} # <<<<<<<<<<<<<< @@ -30564,11 +32400,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_ * 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_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":182 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":182 * include_zeros=0 * result = {} * for i from 0 <= i < self.V: # <<<<<<<<<<<<<< @@ -30578,7 +32414,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_ __pyx_t_3 = __pyx_v_self->V; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":183 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":183 * result = {} * for i from 0 <= i < self.V: * if self.root[i] != NULL: # <<<<<<<<<<<<<< @@ -30588,30 +32424,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_ __pyx_t_1 = (((__pyx_v_self->root[__pyx_v_i]) != NULL) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":184 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":184 * for i from 0 <= i < self.V: * if self.root[i] != NULL: * trie_node_to_map(self.root[i], result, (i,), include_zeros) # <<<<<<<<<<<<<< * 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 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __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_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_4cdec_2sa_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[11]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_4cdec_2sa_3_sa_trie_node_to_map((__pyx_v_self->root[__pyx_v_i]), __pyx_v_result, __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_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L6; } __pyx_L6:; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":185 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":185 * if self.root[i] != NULL: * trie_node_to_map(self.root[i], result, (i,), include_zeros) * return result # <<<<<<<<<<<<<< @@ -30619,12 +32455,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_ * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":174 + * return node + * + * def toMap(self, flag): # <<<<<<<<<<<<<< + * cdef int i, include_zeros + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); @@ -30637,6 +32480,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":200 + * cdef write_map(self, m, FILE* f) + * + * def __cinit__(self, fsarray=None, from_stats=None, from_binary=None, # <<<<<<<<<<<<<< + * precompute_rank=1000, precompute_secondary_rank=20, + * max_length=5, max_nonterminals=2, + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -30656,16 +32507,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_14Precomputation_1__cinit__(PyObject *__pyx_v __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_72,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s_73,&__pyx_n_s__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_precompute_secondary_rank,&__pyx_n_s_max_length,&__pyx_n_s_max_nonterminals,&__pyx_n_s_train_max_initial_size,&__pyx_n_s_train_min_gap_size,0}; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; - - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":200 - * cdef write_map(self, m, FILE* f) - * - * def __cinit__(self, fsarray=None, from_stats=None, from_binary=None, # <<<<<<<<<<<<<< - * precompute_rank=1000, precompute_secondary_rank=20, - * max_length=5, max_nonterminals=2, - */ values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); @@ -30695,47 +32538,47 @@ static int __pyx_pw_4cdec_2sa_3_sa_14Precomputation_1__cinit__(PyObject *__pyx_v switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fsarray); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_stats); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_stats); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_binary); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_binary); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__precompute_rank); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precompute_rank); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_72); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precompute_secondary_rank); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_length); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_length); if (value) { values[5] = value; kw_args--; } } case 6: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_nonterminals); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_nonterminals); if (value) { values[6] = value; kw_args--; } } case 7: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_73); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_train_max_initial_size); if (value) { values[7] = value; kw_args--; } } case 8: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__train_min_gap_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_train_min_gap_size); if (value) { values[8] = value; kw_args--; } } } @@ -30776,6 +32619,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_14Precomputation_1__cinit__(PyObject *__pyx_v return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(((struct __pyx_obj_4cdec_2sa_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); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -30793,67 +32638,67 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":204 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":204 * max_length=5, max_nonterminals=2, * train_max_initial_size=10, train_min_gap_size=2): * self.precompute_rank = precompute_rank # <<<<<<<<<<<<<< * 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_As_int(__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_v_self->precompute_rank = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":205 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":205 * train_max_initial_size=10, train_min_gap_size=2): * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<< * 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_As_int(__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_v_self->precompute_secondary_rank = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":206 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":206 * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank * self.max_length = max_length # <<<<<<<<<<<<<< * 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_As_int(__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_v_self->max_length = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":207 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":207 * self.precompute_secondary_rank = precompute_secondary_rank * self.max_length = max_length * self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<< * 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_As_int(__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_v_self->max_nonterminals = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":208 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":208 * self.max_length = max_length * self.max_nonterminals = max_nonterminals * self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<< * 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_As_int(__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_v_self->train_max_initial_size = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":209 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":209 * self.max_nonterminals = max_nonterminals * self.train_max_initial_size = train_max_initial_size * self.train_min_gap_size = train_min_gap_size # <<<<<<<<<<<<<< * 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_As_int(__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_v_self->train_min_gap_size = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":210 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":210 * self.train_max_initial_size = train_max_initial_size * self.train_min_gap_size = train_min_gap_size * if from_binary: # <<<<<<<<<<<<<< @@ -30863,29 +32708,29 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4 __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;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":211 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":211 * self.train_min_gap_size = train_min_gap_size * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< * elif from_stats: * self.precompute(from_stats, fsarray) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((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 = __Pyx_PyObject_GetAttrStr(((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_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_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 = __Pyx_PyObject_Call(__pyx_t_3, __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_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":212 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":212 * if from_binary: * self.read_binary(from_binary) * elif from_stats: # <<<<<<<<<<<<<< @@ -30895,14 +32740,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4 __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;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":213 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":213 * self.read_binary(from_binary) * elif from_stats: * self.precompute(from_stats, fsarray) # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((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 = __Pyx_PyObject_GetAttrStr(((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_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_GOTREF(__pyx_t_4); @@ -30912,15 +32757,24 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4 __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 = __Pyx_PyObject_Call(__pyx_t_5, __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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L3; } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":200 + * cdef write_map(self, m, FILE* f) + * + * def __cinit__(self, fsarray=None, from_stats=None, from_binary=None, # <<<<<<<<<<<<<< + * precompute_rank=1000, precompute_secondary_rank=20, + * max_length=5, max_nonterminals=2, + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -30934,6 +32788,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4 return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":216 + * + * + * def read_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_3read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_3read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -30954,18 +32816,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_3read_binary(PyObject return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(((struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":216 - * - * - * def read_binary(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "r") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; @@ -30976,16 +32832,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":218 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":218 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< * fread(&(self.precompute_rank), sizeof(int), 1, f) * fread(&(self.precompute_secondary_rank), sizeof(int), 1, f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":219 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":219 * cdef FILE* f * f = fopen(filename, "r") * fread(&(self.precompute_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30994,7 +32850,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ */ fread((&__pyx_v_self->precompute_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":220 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":220 * f = fopen(filename, "r") * fread(&(self.precompute_rank), sizeof(int), 1, f) * fread(&(self.precompute_secondary_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31003,7 +32859,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ */ fread((&__pyx_v_self->precompute_secondary_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":221 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":221 * fread(&(self.precompute_rank), sizeof(int), 1, f) * fread(&(self.precompute_secondary_rank), sizeof(int), 1, f) * fread(&(self.max_length), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31012,7 +32868,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ */ fread((&__pyx_v_self->max_length), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":222 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":222 * fread(&(self.precompute_secondary_rank), sizeof(int), 1, f) * fread(&(self.max_length), sizeof(int), 1, f) * fread(&(self.max_nonterminals), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31021,7 +32877,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ */ fread((&__pyx_v_self->max_nonterminals), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":223 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":223 * fread(&(self.max_length), sizeof(int), 1, f) * fread(&(self.max_nonterminals), sizeof(int), 1, f) * fread(&(self.train_max_initial_size), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31030,7 +32886,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ */ fread((&__pyx_v_self->train_max_initial_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":224 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":224 * fread(&(self.max_nonterminals), sizeof(int), 1, f) * fread(&(self.train_max_initial_size), sizeof(int), 1, f) * fread(&(self.train_min_gap_size), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31039,7 +32895,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ */ fread((&__pyx_v_self->train_min_gap_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":225 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":225 * fread(&(self.train_max_initial_size), sizeof(int), 1, f) * fread(&(self.train_min_gap_size), sizeof(int), 1, f) * self.precomputed_index = self.read_map(f) # <<<<<<<<<<<<<< @@ -31054,7 +32910,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ __pyx_v_self->precomputed_index = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":226 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":226 * fread(&(self.train_min_gap_size), sizeof(int), 1, f) * self.precomputed_index = self.read_map(f) * self.precomputed_collocations = self.read_map(f) # <<<<<<<<<<<<<< @@ -31069,7 +32925,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ __pyx_v_self->precomputed_collocations = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":227 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":227 * self.precomputed_index = self.read_map(f) * self.precomputed_collocations = self.read_map(f) * fclose(f) # <<<<<<<<<<<<<< @@ -31078,6 +32934,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":216 + * + * + * def read_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "r") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -31090,6 +32955,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":230 + * + * + * def write_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_5write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_5write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -31110,18 +32983,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_5write_binary(PyObject return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(((struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":230 - * - * - * def write_binary(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "w") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; @@ -31133,16 +33000,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":232 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":232 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< * fwrite(&(self.precompute_rank), sizeof(int), 1, f) * fwrite(&(self.precompute_secondary_rank), sizeof(int), 1, f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":233 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":233 * cdef FILE* f * f = fopen(filename, "w") * fwrite(&(self.precompute_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31151,7 +33018,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ */ fwrite((&__pyx_v_self->precompute_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":234 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":234 * f = fopen(filename, "w") * fwrite(&(self.precompute_rank), sizeof(int), 1, f) * fwrite(&(self.precompute_secondary_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31160,7 +33027,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ */ fwrite((&__pyx_v_self->precompute_secondary_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":235 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":235 * fwrite(&(self.precompute_rank), sizeof(int), 1, f) * fwrite(&(self.precompute_secondary_rank), sizeof(int), 1, f) * fwrite(&(self.max_length), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31169,7 +33036,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ */ fwrite((&__pyx_v_self->max_length), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":236 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":236 * fwrite(&(self.precompute_secondary_rank), sizeof(int), 1, f) * fwrite(&(self.max_length), sizeof(int), 1, f) * fwrite(&(self.max_nonterminals), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31178,7 +33045,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ */ fwrite((&__pyx_v_self->max_nonterminals), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":237 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":237 * fwrite(&(self.max_length), sizeof(int), 1, f) * fwrite(&(self.max_nonterminals), sizeof(int), 1, f) * fwrite(&(self.train_max_initial_size), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31187,7 +33054,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ */ fwrite((&__pyx_v_self->train_max_initial_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":238 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":238 * fwrite(&(self.max_nonterminals), sizeof(int), 1, f) * fwrite(&(self.train_max_initial_size), sizeof(int), 1, f) * fwrite(&(self.train_min_gap_size), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31196,7 +33063,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ */ fwrite((&__pyx_v_self->train_min_gap_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":239 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":239 * fwrite(&(self.train_max_initial_size), sizeof(int), 1, f) * fwrite(&(self.train_min_gap_size), sizeof(int), 1, f) * self.write_map(self.precomputed_index, f) # <<<<<<<<<<<<<< @@ -31210,7 +33077,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":240 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":240 * fwrite(&(self.train_min_gap_size), sizeof(int), 1, f) * self.write_map(self.precomputed_index, f) * self.write_map(self.precomputed_collocations, f) # <<<<<<<<<<<<<< @@ -31224,7 +33091,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":241 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":241 * self.write_map(self.precomputed_index, f) * self.write_map(self.precomputed_collocations, f) * fclose(f) # <<<<<<<<<<<<<< @@ -31233,6 +33100,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":230 + * + * + * def write_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -31246,7 +33122,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _ return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":244 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":244 * * * cdef write_map(self, m, FILE* f): # <<<<<<<<<<<<<< @@ -31277,7 +33153,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_map", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":248 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":248 * cdef IntList arr * * N = len(m) # <<<<<<<<<<<<<< @@ -31287,7 +33163,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED __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_v_N = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":249 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":249 * * N = len(m) * fwrite(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31296,7 +33172,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED */ fwrite((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":250 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":250 * N = len(m) * fwrite(&(N), sizeof(int), 1, f) * for pattern, val in m.iteritems(): # <<<<<<<<<<<<<< @@ -31308,7 +33184,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __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[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_m, 0, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __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; @@ -31324,7 +33200,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":251 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":251 * fwrite(&(N), sizeof(int), 1, f) * for pattern, val in m.iteritems(): * N = len(pattern) # <<<<<<<<<<<<<< @@ -31334,7 +33210,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED __pyx_t_8 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_N = __pyx_t_8; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":252 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":252 * for pattern, val in m.iteritems(): * N = len(pattern) * fwrite(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31343,7 +33219,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED */ fwrite((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":253 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":253 * N = len(pattern) * fwrite(&(N), sizeof(int), 1, f) * for word_id in pattern: # <<<<<<<<<<<<<< @@ -31376,8 +33252,9 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED } else { __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(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -31387,17 +33264,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED __Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":254 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":254 * fwrite(&(N), sizeof(int), 1, f) * for word_id in pattern: * i = word_id # <<<<<<<<<<<<<< * fwrite(&(i), sizeof(int), 1, f) * arr = val */ - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_word_id); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_i = __pyx_t_7; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":255 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":255 * for word_id in pattern: * i = word_id * fwrite(&(i), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31408,7 +33285,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":256 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":256 * i = word_id * fwrite(&(i), sizeof(int), 1, f) * arr = val # <<<<<<<<<<<<<< @@ -31416,10 +33293,12 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED * */ if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_val); - __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_val)); + __pyx_t_6 = __pyx_v_val; + __Pyx_INCREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_6)); + __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":257 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":257 * fwrite(&(i), sizeof(int), 1, f) * arr = val * arr.write_handle(f) # <<<<<<<<<<<<<< @@ -31430,6 +33309,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":244 + * + * + * cdef write_map(self, m, FILE* f): # <<<<<<<<<<<<<< + * cdef int i, N + * cdef IntList arr + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -31448,7 +33336,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":260 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":260 * * * cdef read_map(self, FILE* f): # <<<<<<<<<<<<<< @@ -31476,7 +33364,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_map", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":264 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":264 * cdef IntList arr * * m = {} # <<<<<<<<<<<<<< @@ -31484,11 +33372,11 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED * 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_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_v_m = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":265 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":265 * * m = {} * fread(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31497,7 +33385,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED */ fread((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":266 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":266 * m = {} * fread(&(N), sizeof(int), 1, f) * for j from 0 <= j < N: # <<<<<<<<<<<<<< @@ -31507,7 +33395,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED __pyx_t_2 = __pyx_v_N; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":267 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":267 * fread(&(N), sizeof(int), 1, f) * for j from 0 <= j < N: * fread(&(i), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31516,17 +33404,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED */ fread((&__pyx_v_i), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":268 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":268 * for j from 0 <= j < N: * fread(&(i), sizeof(int), 1, f) * key = () # <<<<<<<<<<<<<< * for k from 0 <= k < i: * fread(&(word_id), sizeof(int), 1, f) */ - __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); + __Pyx_INCREF(__pyx_empty_tuple); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_empty_tuple); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":269 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":269 * fread(&(i), sizeof(int), 1, f) * key = () * for k from 0 <= k < i: # <<<<<<<<<<<<<< @@ -31536,7 +33424,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED __pyx_t_3 = __pyx_v_i; for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":270 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":270 * key = () * for k from 0 <= k < i: * fread(&(word_id), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31545,40 +33433,40 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED */ fread((&__pyx_v_word_id), (sizeof(int)), 1, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":271 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":271 * for k from 0 <= k < i: * fread(&(word_id), sizeof(int), 1, f) * key = key + (word_id,) # <<<<<<<<<<<<<< * 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 = __Pyx_PyInt_From_int(__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_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_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_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_v_key, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_key, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":272 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":272 * fread(&(word_id), sizeof(int), 1, f) * key = key + (word_id,) * arr = IntList() # <<<<<<<<<<<<<< * arr.read_handle(f) * m[key] = arr */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __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_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":273 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":273 * key = key + (word_id,) * arr = IntList() * arr.read_handle(f) # <<<<<<<<<<<<<< @@ -31587,17 +33475,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_arr->__pyx_vtab)->read_handle(__pyx_v_arr, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":274 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":274 * arr = IntList() * arr.read_handle(f) * m[key] = arr # <<<<<<<<<<<<<< * 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 (unlikely(PyDict_SetItem(__pyx_v_m, __pyx_v_key, ((PyObject *)__pyx_v_arr)) < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":275 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":275 * arr.read_handle(f) * m[key] = arr * return m # <<<<<<<<<<<<<< @@ -31605,12 +33493,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_m)); - __pyx_r = ((PyObject *)__pyx_v_m); + __Pyx_INCREF(__pyx_v_m); + __pyx_r = __pyx_v_m; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":260 + * + * + * cdef read_map(self, FILE* f): # <<<<<<<<<<<<<< + * cdef int i, j, k, word_id, N + * cdef IntList arr + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); @@ -31625,6 +33520,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":278 + * + * + * def precompute(self, stats, SuffixArray sarray): # <<<<<<<<<<<<<< + * cdef int i, l, N, max_pattern_len, i1, l1, i2, l2, i3, l3, ptr1, ptr2, ptr3, is_super, sent_count, max_rank + * cdef DataArray darray = sarray.darray + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -31637,7 +33540,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_7precompute(PyObject * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("precompute (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stats,&__pyx_n_s__sarray,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; @@ -31651,10 +33554,10 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_7precompute(PyObject * kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stats)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sarray)) != 0)) 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;} } @@ -31681,6 +33584,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_7precompute(PyObject * __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sarray), __pyx_ptype_4cdec_2sa_3_sa_SuffixArray, 1, "sarray", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(((struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)__pyx_v_self), __pyx_v_stats, __pyx_v_sarray); + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -31689,14 +33594,6 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_14Precomputation_7precompute(PyObject * return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":278 - * - * - * def precompute(self, stats, SuffixArray sarray): # <<<<<<<<<<<<<< - * cdef int i, l, N, max_pattern_len, i1, l1, i2, l2, i3, l3, ptr1, ptr2, ptr3, is_super, sent_count, max_rank - * cdef DataArray darray = sarray.darray - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_stats, struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_sarray) { int __pyx_v_i; int __pyx_v_l; @@ -31745,7 +33642,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p PyObject *__pyx_v_arity = NULL; PyObject *__pyx_v_cumul_cost = NULL; PyObject *__pyx_v_cumul_count = NULL; - PyObject *__pyx_v_num_found_patterns = NULL; + Py_ssize_t __pyx_v_num_found_patterns; float __pyx_v_stop_time; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -31775,7 +33672,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("precompute", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":280 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":280 * def precompute(self, stats, SuffixArray sarray): * cdef int i, l, N, max_pattern_len, i1, l1, i2, l2, i3, l3, ptr1, ptr2, ptr3, is_super, sent_count, max_rank * cdef DataArray darray = sarray.darray # <<<<<<<<<<<<<< @@ -31787,7 +33684,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_v_darray = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":285 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":285 * cdef _Trie_Node* node * * data = darray.data # <<<<<<<<<<<<<< @@ -31799,7 +33696,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_v_data = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":287 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":287 * data = darray.data * * frequent_patterns = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<< @@ -31817,13 +33714,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p 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_4cdec_2sa_3_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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieMap)), __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_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_frequent_patterns = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":288 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":288 * * frequent_patterns = TrieMap(len(darray.id2word)) * super_frequent_patterns = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<< @@ -31841,13 +33738,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p 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_4cdec_2sa_3_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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieMap)), __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_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_super_frequent_patterns = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":289 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":289 * frequent_patterns = TrieMap(len(darray.id2word)) * super_frequent_patterns = TrieMap(len(darray.id2word)) * collocations = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<< @@ -31865,13 +33762,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p 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_4cdec_2sa_3_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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieMap)), __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_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_collocations = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":291 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":291 * collocations = TrieMap(len(darray.id2word)) * * I_set = set() # <<<<<<<<<<<<<< @@ -31879,11 +33776,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * 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_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_v_I_set = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":292 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":292 * * I_set = set() * J_set = set() # <<<<<<<<<<<<<< @@ -31891,11 +33788,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * 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_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_v_J_set = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":293 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":293 * I_set = set() * J_set = set() * J2_set = set() # <<<<<<<<<<<<<< @@ -31903,11 +33800,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * 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_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_v_J2_set = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":294 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":294 * J_set = set() * J2_set = set() * IJ_set = set() # <<<<<<<<<<<<<< @@ -31915,11 +33812,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * */ __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_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_v_IJ_set = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":295 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":295 * J2_set = set() * IJ_set = set() * pattern_rank = {} # <<<<<<<<<<<<<< @@ -31927,44 +33824,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * 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_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_v_pattern_rank = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":297 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":297 * pattern_rank = {} * * logger.info("Precomputing frequent intersections") # <<<<<<<<<<<<<< * cdef float start_time = monitor_cpu() * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__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_GetModuleGlobalName(__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_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__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 = __Pyx_PyObject_GetAttrStr(__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_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_75), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":298 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":298 * * logger.info("Precomputing frequent intersections") * cdef float start_time = monitor_cpu() # <<<<<<<<<<<<<< * * max_pattern_len = 0 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 298; __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 = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_start_time = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":300 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":300 * cdef float start_time = monitor_cpu() * * max_pattern_len = 0 # <<<<<<<<<<<<<< @@ -31973,7 +33870,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_max_pattern_len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":301 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":301 * * max_pattern_len = 0 * for rank, (_, _, phrase) in enumerate(stats): # <<<<<<<<<<<<<< @@ -32008,8 +33905,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -32050,8 +33948,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); @@ -32088,14 +33985,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":302 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":302 * max_pattern_len = 0 * for rank, (_, _, phrase) in enumerate(stats): * if rank >= self.precompute_rank: # <<<<<<<<<<<<<< * break * max_pattern_len = max(max_pattern_len, len(phrase)) */ - __pyx_t_6 = PyInt_FromLong(__pyx_v_self->precompute_rank); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->precompute_rank); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_6, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -32103,7 +34000,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":303 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":303 * for rank, (_, _, phrase) in enumerate(stats): * if rank >= self.precompute_rank: * break # <<<<<<<<<<<<<< @@ -32111,11 +34008,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * frequent_patterns.insert(phrase) */ goto __pyx_L4_break; - goto __pyx_L7; } - __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":304 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":304 * if rank >= self.precompute_rank: * break * max_pattern_len = max(max_pattern_len, len(phrase)) # <<<<<<<<<<<<<< @@ -32131,27 +34026,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } __pyx_v_max_pattern_len = __pyx_t_15; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":305 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":305 * break * max_pattern_len = max(max_pattern_len, len(phrase)) * frequent_patterns.insert(phrase) # <<<<<<<<<<<<<< * I_set.add(phrase) * pattern_rank[phrase] = rank */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s__insert); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s_insert); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_phrase); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_phrase); __Pyx_GIVEREF(__pyx_v_phrase); - __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":306 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":306 * max_pattern_len = max(max_pattern_len, len(phrase)) * frequent_patterns.insert(phrase) * I_set.add(phrase) # <<<<<<<<<<<<<< @@ -32160,23 +34055,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_t_16 = PySet_Add(__pyx_v_I_set, __pyx_v_phrase); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":307 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":307 * frequent_patterns.insert(phrase) * I_set.add(phrase) * pattern_rank[phrase] = rank # <<<<<<<<<<<<<< * 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 (unlikely(PyDict_SetItem(__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;} - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":308 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":308 * I_set.add(phrase) * pattern_rank[phrase] = rank * if rank < self.precompute_secondary_rank: # <<<<<<<<<<<<<< * super_frequent_patterns.insert(phrase) * J_set.add(phrase) */ - __pyx_t_8 = PyInt_FromLong(__pyx_v_self->precompute_secondary_rank); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->precompute_secondary_rank); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -32184,27 +34079,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":309 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":309 * pattern_rank[phrase] = rank * if rank < self.precompute_secondary_rank: * super_frequent_patterns.insert(phrase) # <<<<<<<<<<<<<< * J_set.add(phrase) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_super_frequent_patterns), __pyx_n_s__insert); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_super_frequent_patterns), __pyx_n_s_insert); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_phrase); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_phrase); __Pyx_GIVEREF(__pyx_v_phrase); - __pyx_t_9 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":310 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":310 * if rank < self.precompute_secondary_rank: * super_frequent_patterns.insert(phrase) * J_set.add(phrase) # <<<<<<<<<<<<<< @@ -32220,7 +34115,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":312 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":312 * J_set.add(phrase) * * queue = IntList(increment=1000) # <<<<<<<<<<<<<< @@ -32228,32 +34123,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * logger.info(" Computing inverted indexes...") */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((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_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __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_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_queue = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":314 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":314 * queue = IntList(increment=1000) * * logger.info(" Computing inverted indexes...") # <<<<<<<<<<<<<< * N = len(data) * for i from 0 <= i < N: */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __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_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_77), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":315 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":315 * * logger.info(" Computing inverted indexes...") * N = len(data) # <<<<<<<<<<<<<< @@ -32263,7 +34158,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __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_v_N = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":316 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":316 * logger.info(" Computing inverted indexes...") * N = len(data) * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -32273,7 +34168,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_14 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":317 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":317 * N = len(data) * for i from 0 <= i < N: * sa_word_id = data.arr[i] # <<<<<<<<<<<<<< @@ -32282,7 +34177,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_sa_word_id = (__pyx_v_data->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":318 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":318 * for i from 0 <= i < N: * sa_word_id = data.arr[i] * if sa_word_id == 1: # <<<<<<<<<<<<<< @@ -32292,7 +34187,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_12 = ((__pyx_v_sa_word_id == 1) != 0); if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":319 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":319 * sa_word_id = data.arr[i] * if sa_word_id == 1: * queue._append(-1) # <<<<<<<<<<<<<< @@ -32304,7 +34199,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":321 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":321 * queue._append(-1) * else: * for l from 1 <= l <= max_pattern_len: # <<<<<<<<<<<<<< @@ -32314,7 +34209,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_17 = __pyx_v_max_pattern_len; for (__pyx_v_l = 1; __pyx_v_l <= __pyx_t_17; __pyx_v_l++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":322 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":322 * else: * for l from 1 <= l <= max_pattern_len: * node = frequent_patterns._contains(data.arr+i, l) # <<<<<<<<<<<<<< @@ -32323,7 +34218,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_node = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i), __pyx_v_l); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":323 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":323 * for l from 1 <= l <= max_pattern_len: * node = frequent_patterns._contains(data.arr+i, l) * if node == NULL: # <<<<<<<<<<<<<< @@ -32333,7 +34228,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_12 = ((__pyx_v_node == NULL) != 0); if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":324 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":324 * node = frequent_patterns._contains(data.arr+i, l) * if node == NULL: * break # <<<<<<<<<<<<<< @@ -32341,11 +34236,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * queue._append(l) */ goto __pyx_L13_break; - goto __pyx_L14; } - __pyx_L14:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":325 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":325 * if node == NULL: * break * queue._append(i) # <<<<<<<<<<<<<< @@ -32354,7 +34247,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_i); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":326 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":326 * break * queue._append(i) * queue._append(l) # <<<<<<<<<<<<<< @@ -32363,7 +34256,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_l); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":327 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":327 * queue._append(i) * queue._append(l) * trie_node_data_append(node, i) # <<<<<<<<<<<<<< @@ -32379,24 +34272,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_L11:; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":329 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":329 * trie_node_data_append(node, i) * * logger.info(" Computing collocations...") # <<<<<<<<<<<<<< * N = len(queue) * ptr1 = 0 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __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_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_79), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":330 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":330 * * logger.info(" Computing collocations...") * N = len(queue) # <<<<<<<<<<<<<< @@ -32406,7 +34299,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __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_v_N = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":331 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":331 * logger.info(" Computing collocations...") * N = len(queue) * ptr1 = 0 # <<<<<<<<<<<<<< @@ -32415,7 +34308,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_ptr1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":332 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":332 * N = len(queue) * ptr1 = 0 * sent_count = 0 # <<<<<<<<<<<<<< @@ -32424,7 +34317,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_sent_count = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":333 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":333 * ptr1 = 0 * sent_count = 0 * while ptr1 < N: # main loop # <<<<<<<<<<<<<< @@ -32435,7 +34328,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_12 = ((__pyx_v_ptr1 < __pyx_v_N) != 0); if (!__pyx_t_12) break; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":334 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":334 * sent_count = 0 * while ptr1 < N: # main loop * i1 = queue.arr[ptr1] # <<<<<<<<<<<<<< @@ -32444,7 +34337,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_i1 = (__pyx_v_queue->arr[__pyx_v_ptr1]); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":335 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":335 * while ptr1 < N: # main loop * i1 = queue.arr[ptr1] * if i1 > -1: # <<<<<<<<<<<<<< @@ -32454,7 +34347,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_12 = ((__pyx_v_i1 > -1) != 0); if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":336 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":336 * i1 = queue.arr[ptr1] * if i1 > -1: * l1 = queue.arr[ptr1+1] # <<<<<<<<<<<<<< @@ -32463,7 +34356,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_l1 = (__pyx_v_queue->arr[(__pyx_v_ptr1 + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":337 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":337 * if i1 > -1: * l1 = queue.arr[ptr1+1] * ptr2 = ptr1 + 2 # <<<<<<<<<<<<<< @@ -32472,7 +34365,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_ptr2 = (__pyx_v_ptr1 + 2); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":338 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":338 * l1 = queue.arr[ptr1+1] * ptr2 = ptr1 + 2 * while ptr2 < N: # <<<<<<<<<<<<<< @@ -32483,7 +34376,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_12 = ((__pyx_v_ptr2 < __pyx_v_N) != 0); if (!__pyx_t_12) break; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":339 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":339 * ptr2 = ptr1 + 2 * while ptr2 < N: * i2 = queue.arr[ptr2] # <<<<<<<<<<<<<< @@ -32492,7 +34385,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_i2 = (__pyx_v_queue->arr[__pyx_v_ptr2]); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":340 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":340 * while ptr2 < N: * i2 = queue.arr[ptr2] * if i2 == -1 or i2 - i1 >= self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -32508,7 +34401,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } if (__pyx_t_19) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":341 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":341 * i2 = queue.arr[ptr2] * if i2 == -1 or i2 - i1 >= self.train_max_initial_size: * break # <<<<<<<<<<<<<< @@ -32516,11 +34409,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * if (i2 - i1 - l1 >= self.train_min_gap_size and */ goto __pyx_L19_break; - goto __pyx_L20; } - __pyx_L20:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":342 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":342 * if i2 == -1 or i2 - i1 >= self.train_max_initial_size: * break * l2 = queue.arr[ptr2+1] # <<<<<<<<<<<<<< @@ -32529,7 +34420,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_l2 = (__pyx_v_queue->arr[(__pyx_v_ptr2 + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":343 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":343 * break * l2 = queue.arr[ptr2+1] * if (i2 - i1 - l1 >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -32539,7 +34430,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_19 = ((((__pyx_v_i2 - __pyx_v_i1) - __pyx_v_l1) >= __pyx_v_self->train_min_gap_size) != 0); if (__pyx_t_19) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":344 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":344 * l2 = queue.arr[ptr2+1] * if (i2 - i1 - l1 >= self.train_min_gap_size and * i2 + l2 - i1 <= self.train_max_initial_size and # <<<<<<<<<<<<<< @@ -32549,7 +34440,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_12 = ((((__pyx_v_i2 + __pyx_v_l2) - __pyx_v_i1) <= __pyx_v_self->train_max_initial_size) != 0); if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":345 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":345 * if (i2 - i1 - l1 >= self.train_min_gap_size and * i2 + l2 - i1 <= self.train_max_initial_size and * l1+l2+1 <= self.max_length): # <<<<<<<<<<<<<< @@ -32567,7 +34458,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":346 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":346 * i2 + l2 - i1 <= self.train_max_initial_size and * l1+l2+1 <= self.max_length): * node = collocations._insert(data.arr+i1, l1) # <<<<<<<<<<<<<< @@ -32576,7 +34467,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_node = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":347 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":347 * l1+l2+1 <= self.max_length): * node = collocations._insert(data.arr+i1, l1) * node = trie_insert(node, -1) # <<<<<<<<<<<<<< @@ -32585,7 +34476,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, -1); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":348 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":348 * node = collocations._insert(data.arr+i1, l1) * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: # <<<<<<<<<<<<<< @@ -32595,7 +34486,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_14 = (__pyx_v_i2 + __pyx_v_l2); for (__pyx_v_i = __pyx_v_i2; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":349 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":349 * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<< @@ -32605,7 +34496,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":350 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":350 * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) # <<<<<<<<<<<<<< @@ -32616,7 +34507,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":351 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":351 * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) # <<<<<<<<<<<<<< @@ -32627,7 +34518,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":352 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":352 * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) * if super_frequent_patterns._contains(data.arr+i2, l2) != NULL: # <<<<<<<<<<<<<< @@ -32637,7 +34528,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_12 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":353 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":353 * trie_node_data_append(node, i2) * if super_frequent_patterns._contains(data.arr+i2, l2) != NULL: * if super_frequent_patterns._contains(data.arr+i1, l1) != NULL: # <<<<<<<<<<<<<< @@ -32647,7 +34538,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_12 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":354 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":354 * if super_frequent_patterns._contains(data.arr+i2, l2) != NULL: * if super_frequent_patterns._contains(data.arr+i1, l1) != NULL: * is_super = 1 # <<<<<<<<<<<<<< @@ -32659,7 +34550,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":356 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":356 * is_super = 1 * else: * is_super = 0 # <<<<<<<<<<<<<< @@ -32670,7 +34561,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } __pyx_L25:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":357 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":357 * else: * is_super = 0 * ptr3 = ptr2 + 2 # <<<<<<<<<<<<<< @@ -32679,7 +34570,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_ptr3 = (__pyx_v_ptr2 + 2); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":358 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":358 * is_super = 0 * ptr3 = ptr2 + 2 * while ptr3 < N: # <<<<<<<<<<<<<< @@ -32690,7 +34581,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_12 = ((__pyx_v_ptr3 < __pyx_v_N) != 0); if (!__pyx_t_12) break; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":359 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":359 * ptr3 = ptr2 + 2 * while ptr3 < N: * i3 = queue.arr[ptr3] # <<<<<<<<<<<<<< @@ -32699,7 +34590,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_i3 = (__pyx_v_queue->arr[__pyx_v_ptr3]); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":360 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":360 * while ptr3 < N: * i3 = queue.arr[ptr3] * if i3 == -1 or i3 - i1 >= self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -32715,7 +34606,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } if (__pyx_t_20) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":361 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":361 * i3 = queue.arr[ptr3] * if i3 == -1 or i3 - i1 >= self.train_max_initial_size: * break # <<<<<<<<<<<<<< @@ -32723,11 +34614,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * if (i3 - i2 - l2 >= self.train_min_gap_size and */ goto __pyx_L27_break; - goto __pyx_L28; } - __pyx_L28:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":362 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":362 * if i3 == -1 or i3 - i1 >= self.train_max_initial_size: * break * l3 = queue.arr[ptr3+1] # <<<<<<<<<<<<<< @@ -32736,7 +34625,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_l3 = (__pyx_v_queue->arr[(__pyx_v_ptr3 + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":363 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":363 * break * l3 = queue.arr[ptr3+1] * if (i3 - i2 - l2 >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -32746,7 +34635,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_20 = ((((__pyx_v_i3 - __pyx_v_i2) - __pyx_v_l2) >= __pyx_v_self->train_min_gap_size) != 0); if (__pyx_t_20) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":364 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":364 * l3 = queue.arr[ptr3+1] * if (i3 - i2 - l2 >= self.train_min_gap_size and * i3 + l3 - i1 <= self.train_max_initial_size and # <<<<<<<<<<<<<< @@ -32756,7 +34645,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_12 = ((((__pyx_v_i3 + __pyx_v_l3) - __pyx_v_i1) <= __pyx_v_self->train_max_initial_size) != 0); if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":365 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":365 * if (i3 - i2 - l2 >= self.train_min_gap_size and * i3 + l3 - i1 <= self.train_max_initial_size and * l1+l2+l3+2 <= self.max_length): # <<<<<<<<<<<<<< @@ -32774,7 +34663,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":366 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":366 * i3 + l3 - i1 <= self.train_max_initial_size and * l1+l2+l3+2 <= self.max_length): * if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL: # <<<<<<<<<<<<<< @@ -32789,7 +34678,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } if (__pyx_t_20) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":367 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":367 * l1+l2+l3+2 <= self.max_length): * if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL: * node = collocations._insert(data.arr+i1, l1) # <<<<<<<<<<<<<< @@ -32798,7 +34687,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_node = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":368 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":368 * if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL: * node = collocations._insert(data.arr+i1, l1) * node = trie_insert(node, -1) # <<<<<<<<<<<<<< @@ -32807,7 +34696,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, -1); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":369 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":369 * node = collocations._insert(data.arr+i1, l1) * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: # <<<<<<<<<<<<<< @@ -32817,7 +34706,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_14 = (__pyx_v_i2 + __pyx_v_l2); for (__pyx_v_i = __pyx_v_i2; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":370 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":370 * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<< @@ -32827,7 +34716,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":371 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":371 * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) * node = trie_insert(node, -1) # <<<<<<<<<<<<<< @@ -32836,7 +34725,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, -1); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":372 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":372 * node = trie_insert(node, data.arr[i]) * node = trie_insert(node, -1) * for i from i3 <= i < i3+l3: # <<<<<<<<<<<<<< @@ -32846,7 +34735,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_14 = (__pyx_v_i3 + __pyx_v_l3); for (__pyx_v_i = __pyx_v_i3; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":373 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":373 * node = trie_insert(node, -1) * for i from i3 <= i < i3+l3: * node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<< @@ -32856,7 +34745,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":374 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":374 * for i from i3 <= i < i3+l3: * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) # <<<<<<<<<<<<<< @@ -32867,7 +34756,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":375 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":375 * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) # <<<<<<<<<<<<<< @@ -32878,7 +34767,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":376 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":376 * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) * trie_node_data_append(node, i3) # <<<<<<<<<<<<<< @@ -32895,7 +34784,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } __pyx_L29:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":377 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":377 * trie_node_data_append(node, i2) * trie_node_data_append(node, i3) * ptr3 = ptr3 + 2 # <<<<<<<<<<<<<< @@ -32912,7 +34801,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } __pyx_L21:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":378 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":378 * trie_node_data_append(node, i3) * ptr3 = ptr3 + 2 * ptr2 = ptr2 + 2 # <<<<<<<<<<<<<< @@ -32923,7 +34812,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } __pyx_L19_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":379 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":379 * ptr3 = ptr3 + 2 * ptr2 = ptr2 + 2 * ptr1 = ptr1 + 2 # <<<<<<<<<<<<<< @@ -32935,7 +34824,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":381 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":381 * ptr1 = ptr1 + 2 * else: * sent_count = sent_count + 1 # <<<<<<<<<<<<<< @@ -32944,7 +34833,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_sent_count = (__pyx_v_sent_count + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":382 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":382 * else: * sent_count = sent_count + 1 * if sent_count % 10000 == 0: # <<<<<<<<<<<<<< @@ -32954,38 +34843,38 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_20 = ((__Pyx_mod_long(__pyx_v_sent_count, 10000) == 0) != 0); if (__pyx_t_20) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":383 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":383 * sent_count = sent_count + 1 * if sent_count % 10000 == 0: * logger.debug(" %d sentences", sent_count) # <<<<<<<<<<<<<< * ptr1 = ptr1 + 1 * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__debug); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __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_t_1 = PyInt_FromLong(__pyx_v_sent_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_sent_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_80)); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_80)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_80)); + __Pyx_INCREF(__pyx_kp_s_d_sentences); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s_d_sentences); + __Pyx_GIVEREF(__pyx_kp_s_d_sentences); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __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_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L35; } __pyx_L35:; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":384 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":384 * if sent_count % 10000 == 0: * logger.debug(" %d sentences", sent_count) * ptr1 = ptr1 + 1 # <<<<<<<<<<<<<< @@ -32997,59 +34886,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_L17:; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":386 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":386 * ptr1 = ptr1 + 1 * * self.precomputed_collocations = collocations.toMap(False) # <<<<<<<<<<<<<< * self.precomputed_index = frequent_patterns.toMap(True) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_collocations), __pyx_n_s__toMap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_collocations), __pyx_n_s_toMap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __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[11]; __pyx_lineno = 386; __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(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_9); __Pyx_GOTREF(__pyx_v_self->precomputed_collocations); __Pyx_DECREF(__pyx_v_self->precomputed_collocations); __pyx_v_self->precomputed_collocations = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":387 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":387 * * self.precomputed_collocations = collocations.toMap(False) * self.precomputed_index = frequent_patterns.toMap(True) # <<<<<<<<<<<<<< * * x = 0 */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s__toMap); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s_toMap); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(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_PyObject_Call(__pyx_t_9, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->precomputed_index); __Pyx_DECREF(__pyx_v_self->precomputed_index); - __pyx_v_self->precomputed_index = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_self->precomputed_index = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":389 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":389 * self.precomputed_index = frequent_patterns.toMap(True) * * x = 0 # <<<<<<<<<<<<<< @@ -33059,57 +34932,59 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_INCREF(__pyx_int_0); __pyx_v_x = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":390 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":390 * * x = 0 * for pattern1 in J_set: # <<<<<<<<<<<<<< * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: */ - __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_J_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + __pyx_t_1 = PyObject_GetIter(__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_GOTREF(__pyx_t_1); + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; for (;;) { { - __pyx_t_1 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_9 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); } - __Pyx_XDECREF_SET(__pyx_v_pattern1, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_pattern1, __pyx_t_9); + __pyx_t_9 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":391 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":391 * x = 0 * for pattern1 in J_set: * for pattern2 in J_set: # <<<<<<<<<<<<<< * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 */ - __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_J_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_21 = Py_TYPE(__pyx_t_1)->tp_iternext; + __pyx_t_9 = PyObject_GetIter(__pyx_v_J_set); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_21 = Py_TYPE(__pyx_t_9)->tp_iternext; for (;;) { { - __pyx_t_9 = __pyx_t_21(__pyx_t_1); - if (unlikely(!__pyx_t_9)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_3 = __pyx_t_21(__pyx_t_9); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_v_pattern2, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_pattern2, __pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":392 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":392 * for pattern1 in J_set: * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: # <<<<<<<<<<<<<< @@ -33121,22 +34996,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_20 = ((((__pyx_t_2 + __pyx_t_15) + 1) < __pyx_v_self->max_length) != 0); if (__pyx_t_20) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":393 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":393 * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< * J2_set.add(combined_pattern) * */ - __pyx_t_9 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_81)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_v_pattern2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_v_pattern1, __pyx_tuple__52); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyNumber_Add(__pyx_t_3, __pyx_v_pattern2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_combined_pattern, __pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":394 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":394 * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 * J2_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -33148,51 +35023,53 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } __pyx_L40:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":396 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":396 * J2_set.add(combined_pattern) * * for pattern1 in I_set: # <<<<<<<<<<<<<< * for pattern2 in I_set: * x = x+1 */ - __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + __pyx_t_1 = PyObject_GetIter(__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_GOTREF(__pyx_t_1); + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; for (;;) { { - __pyx_t_1 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_9 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); } - __Pyx_XDECREF_SET(__pyx_v_pattern1, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_pattern1, __pyx_t_9); + __pyx_t_9 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":397 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":397 * * for pattern1 in I_set: * for pattern2 in I_set: # <<<<<<<<<<<<<< * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: */ - __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_21 = Py_TYPE(__pyx_t_1)->tp_iternext; + __pyx_t_9 = PyObject_GetIter(__pyx_v_I_set); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_21 = Py_TYPE(__pyx_t_9)->tp_iternext; for (;;) { { - __pyx_t_8 = __pyx_t_21(__pyx_t_1); + __pyx_t_8 = __pyx_t_21(__pyx_t_9); if (unlikely(!__pyx_t_8)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -33202,7 +35079,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_XDECREF_SET(__pyx_v_pattern2, __pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":398 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":398 * for pattern1 in I_set: * for pattern2 in I_set: * x = x+1 # <<<<<<<<<<<<<< @@ -33214,7 +35091,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":399 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":399 * for pattern2 in I_set: * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: # <<<<<<<<<<<<<< @@ -33226,22 +35103,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_20 = ((((__pyx_t_15 + __pyx_t_2) + 1) <= __pyx_v_self->max_length) != 0); if (__pyx_t_20) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":400 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":400 * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< * IJ_set.add(combined_pattern) * */ - __pyx_t_8 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_82)); 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_v_pattern1, __pyx_tuple__53); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_combined_pattern, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_combined_pattern, __pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":401 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":401 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -33253,73 +35130,75 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } __pyx_L45:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":403 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":403 * IJ_set.add(combined_pattern) * * for pattern1 in I_set: # <<<<<<<<<<<<<< * for pattern2 in J2_set: * x = x+2 */ - __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + __pyx_t_1 = PyObject_GetIter(__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_GOTREF(__pyx_t_1); + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; for (;;) { { - __pyx_t_1 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_9 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); } - __Pyx_XDECREF_SET(__pyx_v_pattern1, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_pattern1, __pyx_t_9); + __pyx_t_9 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":404 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":404 * * for pattern1 in I_set: * for pattern2 in J2_set: # <<<<<<<<<<<<<< * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: */ - __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_J2_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_21 = Py_TYPE(__pyx_t_1)->tp_iternext; + __pyx_t_9 = PyObject_GetIter(__pyx_v_J2_set); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_21 = Py_TYPE(__pyx_t_9)->tp_iternext; for (;;) { { - __pyx_t_9 = __pyx_t_21(__pyx_t_1); - if (unlikely(!__pyx_t_9)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_3 = __pyx_t_21(__pyx_t_9); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_v_pattern2, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_pattern2, __pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":405 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":405 * for pattern1 in I_set: * for pattern2 in J2_set: * x = x+2 # <<<<<<<<<<<<<< * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 */ - __pyx_t_9 = PyNumber_Add(__pyx_v_x, __pyx_int_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_v_x, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":406 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":406 * for pattern2 in J2_set: * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: # <<<<<<<<<<<<<< @@ -33331,22 +35210,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_20 = ((((__pyx_t_2 + __pyx_t_15) + 1) <= __pyx_v_self->max_length) != 0); if (__pyx_t_20) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":407 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":407 * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 */ - __pyx_t_9 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_83)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_v_pattern2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_v_pattern1, __pyx_tuple__54); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyNumber_Add(__pyx_t_3, __pyx_v_pattern2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_combined_pattern, __pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":408 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":408 * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -33355,22 +35234,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_t_16 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":409 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":409 * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 # <<<<<<<<<<<<<< * IJ_set.add(combined_pattern) * */ - __pyx_t_8 = PyNumber_Add(__pyx_v_pattern2, ((PyObject *)__pyx_k_tuple_84)); 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_v_pattern2, __pyx_tuple__55); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v_combined_pattern, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_DECREF_SET(__pyx_v_combined_pattern, __pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":410 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":410 * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 * IJ_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -33382,59 +35261,59 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p } __pyx_L50:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":412 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":412 * IJ_set.add(combined_pattern) * * N = len(pattern_rank) # <<<<<<<<<<<<<< * cost_by_rank = IntList(initial_len=N) * count_by_rank = IntList(initial_len=N) */ - __pyx_t_15 = PyDict_Size(((PyObject *)__pyx_v_pattern_rank)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyDict_Size(__pyx_v_pattern_rank); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_N = __pyx_t_15; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":413 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":413 * * N = len(pattern_rank) * cost_by_rank = IntList(initial_len=N) # <<<<<<<<<<<<<< * count_by_rank = IntList(initial_len=N) * for pattern, arr in self.precomputed_collocations.iteritems(): */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __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 = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_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 = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_initial_len, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_v_cost_by_rank = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_cost_by_rank = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_9); + __pyx_t_9 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":414 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":414 * N = len(pattern_rank) * cost_by_rank = IntList(initial_len=N) * count_by_rank = IntList(initial_len=N) # <<<<<<<<<<<<<< * for pattern, arr in self.precomputed_collocations.iteritems(): * if pattern not in IJ_set: */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __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 = 414; __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 = 414; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_v_count_by_rank = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_initial_len, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_count_by_rank = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":415 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":415 * cost_by_rank = IntList(initial_len=N) * count_by_rank = IntList(initial_len=N) * for pattern, arr in self.precomputed_collocations.iteritems(): # <<<<<<<<<<<<<< @@ -33446,44 +35325,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_self->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_2), (&__pyx_t_14)); 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_XDECREF(__pyx_t_3); - __pyx_t_3 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_self->precomputed_collocations, 0, __pyx_n_s_iteritems, (&__pyx_t_2), (&__pyx_t_14)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_9; + __pyx_t_9 = 0; while (1) { - __pyx_t_17 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_2, &__pyx_t_15, &__pyx_t_1, &__pyx_t_9, NULL, __pyx_t_14); + __pyx_t_17 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_15, &__pyx_t_9, &__pyx_t_3, NULL, __pyx_t_14); if (unlikely(__pyx_t_17 == 0)) break; if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_1); - __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_9); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":416 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":416 * count_by_rank = IntList(initial_len=N) * for pattern, arr in self.precomputed_collocations.iteritems(): * if pattern not in IJ_set: # <<<<<<<<<<<<<< * s = "" * for word_id in pattern: */ - __pyx_t_20 = (__Pyx_PySequence_Contains(__pyx_v_pattern, ((PyObject *)__pyx_v_IJ_set), Py_NE)); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = (__Pyx_PySequence_Contains(__pyx_v_pattern, __pyx_v_IJ_set, Py_NE)); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = (__pyx_t_20 != 0); if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":417 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":417 * for pattern, arr in self.precomputed_collocations.iteritems(): * if pattern not in IJ_set: * s = "" # <<<<<<<<<<<<<< * for word_id in pattern: * if word_id == -1: */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_47)); - __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject *)__pyx_kp_s_47)); + __Pyx_INCREF(__pyx_kp_s__32); + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_kp_s__32); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":418 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":418 * if pattern not in IJ_set: * s = "" * for word_id in pattern: # <<<<<<<<<<<<<< @@ -33491,131 +35370,132 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p * s = s + "X " */ if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) { - __pyx_t_9 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_9); __pyx_t_13 = 0; + __pyx_t_3 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = Py_TYPE(__pyx_t_9)->tp_iternext; + __pyx_t_13 = -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_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } for (;;) { - if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_9)) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_9)) break; + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_9)) { - if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_9); - if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_9 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); } - __Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_9); + __pyx_t_9 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":419 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":419 * s = "" * for word_id in pattern: * if word_id == -1: # <<<<<<<<<<<<<< * s = s + "X " * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":420 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":420 * for word_id in pattern: * if word_id == -1: * s = s + "X " # <<<<<<<<<<<<<< * else: * s = s + darray.id2word[word_id] + " " */ - __pyx_t_1 = PyNumber_Add(__pyx_v_s, ((PyObject *)__pyx_kp_s_85)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_v_s, __pyx_kp_s_X); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_9); + __pyx_t_9 = 0; goto __pyx_L56; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":422 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":422 * s = s + "X " * else: * s = s + darray.id2word[word_id] + " " # <<<<<<<<<<<<<< * logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s) * else: */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_darray->id2word, __pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Add(__pyx_v_s, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetItem(__pyx_v_darray->id2word, __pyx_v_word_id); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyNumber_Add(__pyx_v_s, __pyx_t_9); 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_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_8, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__46); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_9); + __pyx_t_9 = 0; } __pyx_L56:; } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":423 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":423 * else: * s = s + darray.id2word[word_id] + " " * logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s) # <<<<<<<<<<<<<< * else: * chunk = () */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s__warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__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_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_86)); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_86)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_86)); + __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_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_ERROR_unexpected_pattern_s_in_se); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_ERROR_unexpected_pattern_s_in_se); + __Pyx_GIVEREF(__pyx_kp_s_ERROR_unexpected_pattern_s_in_se); __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_s); __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L53; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":425 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":425 * logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s) * else: * chunk = () # <<<<<<<<<<<<<< * max_rank = 0 * arity = 0 */ - __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); + __Pyx_INCREF(__pyx_empty_tuple); __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_empty_tuple); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":426 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":426 * else: * chunk = () * max_rank = 0 # <<<<<<<<<<<<<< @@ -33624,7 +35504,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p */ __pyx_v_max_rank = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":427 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":427 * chunk = () * max_rank = 0 * arity = 0 # <<<<<<<<<<<<<< @@ -33634,7 +35514,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_arity, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":428 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":428 * max_rank = 0 * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -33653,151 +35533,152 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_8)) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_8)) { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_9 = __pyx_t_5(__pyx_t_8); - if (unlikely(!__pyx_t_9)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + __pyx_t_3 = __pyx_t_5(__pyx_t_8); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":429 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":429 * arity = 0 * for word_id in pattern: * if word_id == -1: # <<<<<<<<<<<<<< * max_rank = max(max_rank, pattern_rank[chunk]) * arity = arity + 1 */ - __pyx_t_9 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 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; if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":430 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":430 * for word_id in pattern: * if word_id == -1: * max_rank = max(max_rank, pattern_rank[chunk]) # <<<<<<<<<<<<<< * arity = arity + 1 * chunk = () */ - __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_pattern_rank, __pyx_v_chunk); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); __pyx_t_17 = __pyx_v_max_rank; - __pyx_t_6 = PyInt_FromLong(__pyx_t_17); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_17); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_12) { - __Pyx_INCREF(__pyx_t_9); - __pyx_t_1 = __pyx_t_9; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_9 = __pyx_t_3; } else { - __pyx_t_7 = PyInt_FromLong(__pyx_t_17); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_17); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __pyx_t_7; + __pyx_t_9 = __pyx_t_7; __pyx_t_7 = 0; } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_17 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_max_rank = __pyx_t_17; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":431 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":431 * if word_id == -1: * max_rank = max(max_rank, pattern_rank[chunk]) * arity = arity + 1 # <<<<<<<<<<<<<< * chunk = () * else: */ - __pyx_t_1 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_arity, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF_SET(__pyx_v_arity, __pyx_t_9); + __pyx_t_9 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":432 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":432 * max_rank = max(max_rank, pattern_rank[chunk]) * arity = arity + 1 * chunk = () # <<<<<<<<<<<<<< * else: * chunk = chunk + (word_id,) */ - __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); + __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_chunk, __pyx_empty_tuple); goto __pyx_L59; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":434 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":434 * chunk = () * else: * chunk = chunk + (word_id,) # <<<<<<<<<<<<<< * 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_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_word_id); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_word_id); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_word_id); __Pyx_GIVEREF(__pyx_v_word_id); - __pyx_t_9 = PyNumber_Add(((PyObject *)__pyx_v_chunk), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_chunk, ((PyObject*)__pyx_t_9)); - __pyx_t_9 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_v_chunk, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF_SET(__pyx_v_chunk, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; } __pyx_L59:; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":435 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":435 * else: * chunk = chunk + (word_id,) * max_rank = max(max_rank, pattern_rank[chunk]) # <<<<<<<<<<<<<< * 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_t_8 = __Pyx_PyDict_GetItem(__pyx_v_pattern_rank, __pyx_v_chunk); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); __pyx_t_17 = __pyx_v_max_rank; - __pyx_t_1 = PyInt_FromLong(__pyx_t_17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_t_17); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_t_9, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_12) { __Pyx_INCREF(__pyx_t_8); - __pyx_t_9 = __pyx_t_8; + __pyx_t_3 = __pyx_t_8; } else { - __pyx_t_7 = PyInt_FromLong(__pyx_t_17); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_17); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __pyx_t_7; + __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_17 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_17 == (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_17; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":436 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":436 * chunk = chunk + (word_id,) * max_rank = max(max_rank, pattern_rank[chunk]) * cost_by_rank.arr[max_rank] = cost_by_rank.arr[max_rank] + (4*len(arr)) # <<<<<<<<<<<<<< @@ -33807,37 +35688,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_13 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_13 == -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_13)); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":437 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":437 * max_rank = max(max_rank, pattern_rank[chunk]) * 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)) # <<<<<<<<<<<<<< * * cumul_cost = 0 */ - __pyx_t_9 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_max_rank])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyInt_From_int((__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_13 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_17 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; (__pyx_v_count_by_rank->arr[__pyx_v_max_rank]) = __pyx_t_17; } __pyx_L53:; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":439 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":439 * count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1)) * * cumul_cost = 0 # <<<<<<<<<<<<<< @@ -33847,7 +35728,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_INCREF(__pyx_int_0); __pyx_v_cumul_cost = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":440 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":440 * * cumul_cost = 0 * cumul_count = 0 # <<<<<<<<<<<<<< @@ -33857,7 +35738,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_INCREF(__pyx_int_0); __pyx_v_cumul_count = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":441 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":441 * cumul_cost = 0 * cumul_count = 0 * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -33867,113 +35748,111 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_14 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":442 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":442 * cumul_count = 0 * for i from 0 <= i < N: * cumul_cost = cumul_cost + cost_by_rank.arr[i] # <<<<<<<<<<<<<< * 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_3 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Add(__pyx_v_cumul_cost, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int((__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_GOTREF(__pyx_t_1); + __pyx_t_7 = PyNumber_Add(__pyx_v_cumul_cost, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_cumul_cost, __pyx_t_7); __pyx_t_7 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":443 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":443 * for i from 0 <= i < N: * cumul_cost = cumul_cost + cost_by_rank.arr[i] * 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_7 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_From_int((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Add(__pyx_v_cumul_count, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_v_cumul_count, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_cumul_count, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_cumul_count, __pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":444 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":444 * cumul_cost = cumul_cost + cost_by_rank.arr[i] * 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) # <<<<<<<<<<<<<< * * num_found_patterns = len(self.precomputed_collocations) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__debug); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__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_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_debug); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromLong(__pyx_v_i); 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_1 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_From_int((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyInt_From_int((__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_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_GOTREF(__pyx_t_8); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_87)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_87)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_87)); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_RANK_d_COUNT_COST_d_d_CUMUL_d_d); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_s_RANK_d_COUNT_COST_d_d_CUMUL_d_d); + __Pyx_GIVEREF(__pyx_kp_s_RANK_d_COUNT_COST_d_d_CUMUL_d_d); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_cumul_count); PyTuple_SET_ITEM(__pyx_t_8, 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); __Pyx_GIVEREF(__pyx_v_cumul_cost); - __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __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_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":446 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":446 * 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) * * num_found_patterns = len(self.precomputed_collocations) # <<<<<<<<<<<<<< * for pattern in IJ_set: * if pattern not in self.precomputed_collocations: */ - __pyx_t_9 = __pyx_v_self->precomputed_collocations; - __Pyx_INCREF(__pyx_t_9); - __pyx_t_2 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_v_num_found_patterns = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_3 = __pyx_v_self->precomputed_collocations; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -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_v_num_found_patterns = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":447 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":447 * * num_found_patterns = len(self.precomputed_collocations) * for pattern in IJ_set: # <<<<<<<<<<<<<< * if pattern not in self.precomputed_collocations: * self.precomputed_collocations[pattern] = IntList() */ - __pyx_t_9 = PyObject_GetIter(((PyObject *)__pyx_v_IJ_set)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = Py_TYPE(__pyx_t_9)->tp_iternext; + __pyx_t_3 = PyObject_GetIter(__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_5 = Py_TYPE(__pyx_t_3)->tp_iternext; for (;;) { { - __pyx_t_8 = __pyx_t_5(__pyx_t_9); + __pyx_t_8 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_8)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -33983,7 +35862,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":448 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":448 * num_found_patterns = len(self.precomputed_collocations) * for pattern in IJ_set: * if pattern not in self.precomputed_collocations: # <<<<<<<<<<<<<< @@ -33994,134 +35873,145 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __pyx_t_20 = (__pyx_t_12 != 0); if (__pyx_t_20) { - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":449 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":449 * for pattern in IJ_set: * if pattern not in self.precomputed_collocations: * self.precomputed_collocations[pattern] = IntList() # <<<<<<<<<<<<<< * * cdef float stop_time = monitor_cpu() */ - __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_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_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __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;} + if (unlikely(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_L64; } __pyx_L64:; } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":451 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":451 * self.precomputed_collocations[pattern] = IntList() * * cdef float stop_time = monitor_cpu() # <<<<<<<<<<<<<< * 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_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_stop_time = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":452 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":452 * * cdef float stop_time = monitor_cpu() * 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __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[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_info); 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 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_num_found_patterns); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_v_self->precomputed_collocations; + __Pyx_INCREF(__pyx_t_7); + __pyx_t_2 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_88)); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_88)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_88)); - __Pyx_INCREF(__pyx_v_num_found_patterns); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_num_found_patterns); - __Pyx_GIVEREF(__pyx_v_num_found_patterns); - PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8); + __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_kp_s_Precomputed_collocations_for_d_p); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s_Precomputed_collocations_for_d_p); + __Pyx_GIVEREF(__pyx_kp_s_Precomputed_collocations_for_d_p); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":453 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":453 * cdef float stop_time = monitor_cpu() * 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __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_index; - __Pyx_INCREF(__pyx_t_8); - __pyx_t_2 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_2 == -1)) {__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 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_89)); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_89)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_89)); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __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_9)); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __pyx_v_self->precomputed_index; + __Pyx_INCREF(__pyx_t_7); + __pyx_t_2 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyTuple_New(2); 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_INCREF(__pyx_kp_s_Precomputed_inverted_index_for_d); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_Precomputed_inverted_index_for_d); + __Pyx_GIVEREF(__pyx_kp_s_Precomputed_inverted_index_for_d); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":454 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_info); 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_7); __pyx_t_7 = 0; + __pyx_t_7 = PyFloat_FromDouble((__pyx_v_stop_time - __pyx_v_start_time)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __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[11]; __pyx_lineno = 454; __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[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(__pyx_kp_s_Precomputation_took_f_seconds); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s_Precomputation_took_f_seconds); + __Pyx_GIVEREF(__pyx_kp_s_Precomputation_took_f_seconds); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_90)); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_90)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_90)); - 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_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __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_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":278 + * + * + * def precompute(self, stats, SuffixArray sarray): # <<<<<<<<<<<<<< + * cdef int i, l, N, max_pattern_len, i1, l1, i2, l2, i3, l3, ptr1, ptr2, ptr3, is_super, sent_count, max_rank + * cdef DataArray darray = sarray.darray + */ + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -34163,12 +36053,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p __Pyx_XDECREF(__pyx_v_arity); __Pyx_XDECREF(__pyx_v_cumul_cost); __Pyx_XDECREF(__pyx_v_cumul_count); - __Pyx_XDECREF(__pyx_v_num_found_patterns); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":11 + * cdef IntList ha + * + * def __cinit__(self, from_binary=None, from_text=None, side=None): # <<<<<<<<<<<<<< + * self.darray = DataArray() + * self.sa = IntList() + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -34182,16 +36079,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__side,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_from_binary,&__pyx_n_s_from_text,&__pyx_n_s_side,0}; PyObject* values[3] = {0,0,0}; - - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":11 - * cdef IntList ha - * - * def __cinit__(self, from_binary=None, from_text=None, side=None): # <<<<<<<<<<<<<< - * self.darray = DataArray() - * self.sa = IntList() - */ values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); @@ -34209,17 +36098,17 @@ static int __pyx_pw_4cdec_2sa_3_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_se switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_binary); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_binary); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_text); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_text); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__side); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_side); if (value) { values[2] = value; kw_args--; } } } @@ -34248,6 +36137,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_se return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_from_binary, __pyx_v_from_text, __pyx_v_side); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -34264,14 +36155,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":12 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":12 * * def __cinit__(self, from_binary=None, from_text=None, side=None): * self.darray = DataArray() # <<<<<<<<<<<<<< * self.sa = IntList() * self.ha = IntList() */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_DataArray)), __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_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->darray); @@ -34279,14 +36170,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde __pyx_v_self->darray = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":13 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":13 * def __cinit__(self, from_binary=None, from_text=None, side=None): * self.darray = DataArray() * self.sa = IntList() # <<<<<<<<<<<<<< * self.ha = IntList() * if from_binary: */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __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_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sa); @@ -34294,14 +36185,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde __pyx_v_self->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":14 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":14 * self.darray = DataArray() * self.sa = IntList() * self.ha = IntList() # <<<<<<<<<<<<<< * if from_binary: * self.read_binary(from_binary) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __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_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->ha); @@ -34309,7 +36200,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde __pyx_v_self->ha = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":15 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":15 * self.sa = IntList() * self.ha = IntList() * if from_binary: # <<<<<<<<<<<<<< @@ -34319,29 +36210,29 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde __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;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":16 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":16 * self.ha = IntList() * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< * elif from_text: * self.read_text(from_text, side) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((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 = __Pyx_PyObject_GetAttrStr(((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_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_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 = __Pyx_PyObject_Call(__pyx_t_1, __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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":17 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":17 * if from_binary: * self.read_binary(from_binary) * elif from_text: # <<<<<<<<<<<<<< @@ -34351,14 +36242,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde __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;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":18 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":18 * self.read_binary(from_binary) * elif from_text: * self.read_text(from_text, side) # <<<<<<<<<<<<<< * * def __getitem__(self, i): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((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 = __Pyx_PyObject_GetAttrStr(((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_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -34368,15 +36259,24 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde __Pyx_INCREF(__pyx_v_side); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_side); __Pyx_GIVEREF(__pyx_v_side); - __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 = __Pyx_PyObject_Call(__pyx_t_4, __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_GOTREF(__pyx_t_1); __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(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3; } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":11 + * cdef IntList ha + * + * def __cinit__(self, from_binary=None, from_text=None, side=None): # <<<<<<<<<<<<<< + * self.darray = DataArray() + * self.sa = IntList() + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -34390,6 +36290,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":20 + * self.read_text(from_text, side) + * + * def __getitem__(self, i): # <<<<<<<<<<<<<< + * return self.sa.arr[i] + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { @@ -34397,18 +36305,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_3__getitem__(PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11SuffixArray_2__getitem__(((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":20 - * self.read_text(from_text, side) - * - * def __getitem__(self, i): # <<<<<<<<<<<<<< - * return self.sa.arr[i] - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_2__getitem__(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -34419,7 +36321,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_2__getitem__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":21 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":21 * * def __getitem__(self, i): * return self.sa.arr[i] # <<<<<<<<<<<<<< @@ -34428,14 +36330,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_2__getitem__(struct __pyx */ __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_2 = __Pyx_PyInt_From_int((__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_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":20 + * self.read_text(from_text, side) + * + * def __getitem__(self, i): # <<<<<<<<<<<<<< + * return self.sa.arr[i] + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.SuffixArray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -34446,6 +36355,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_2__getitem__(struct __pyx return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":23 + * return self.sa.arr[i] + * + * def read_text(self, filename, side): # <<<<<<<<<<<<<< + * '''Constructs suffix array using the algorithm + * of Larsson & Sadahkane (1999)''' + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_5read_text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4cdec_2sa_3_sa_11SuffixArray_4read_text[] = "Constructs suffix array using the algorithm\n of Larsson & Sadahkane (1999)"; @@ -34459,7 +36376,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_5read_text(PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_text (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__side,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_side,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -34473,10 +36390,10 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_5read_text(PyObject *__py kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__side)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_side)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("read_text", 1, 2, 2, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -34502,18 +36419,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_5read_text(PyObject *__py return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_filename, __pyx_v_side); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":23 - * return self.sa.arr[i] - * - * def read_text(self, filename, side): # <<<<<<<<<<<<<< - * '''Constructs suffix array using the algorithm - * of Larsson & Sadahkane (1999)''' - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_side) { int __pyx_v_V; int __pyx_v_N; @@ -34547,7 +36458,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":29 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":29 * cdef IntList isa, word_count * * self.darray = DataArray(from_text=filename, side=side, use_sent_id=True) # <<<<<<<<<<<<<< @@ -34555,23 +36466,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o * V = len(self.darray.id2word) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__from_text), __pyx_v_filename) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__side), __pyx_v_side) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __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 = 29; __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_4cdec_2sa_3_sa_DataArray)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_from_text, __pyx_v_filename) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_side, __pyx_v_side) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_use_sent_id, Py_True) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_DataArray)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__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_4cdec_2sa_3_sa_DataArray *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":30 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":30 * * self.darray = DataArray(from_text=filename, side=side, use_sent_id=True) * N = len(self.darray) # <<<<<<<<<<<<<< @@ -34584,7 +36492,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_N = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":31 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":31 * self.darray = DataArray(from_text=filename, side=side, use_sent_id=True) * N = len(self.darray) * V = len(self.darray.id2word) # <<<<<<<<<<<<<< @@ -34597,7 +36505,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_V = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":33 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":33 * V = len(self.darray.id2word) * * self.sa = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -34605,21 +36513,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o * */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; __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 = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; __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 = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_initial_len, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__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_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":34 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":34 * * self.sa = IntList(initial_len=N) * self.ha = IntList(initial_len=V+1) # <<<<<<<<<<<<<< @@ -34627,21 +36535,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o * isa = IntList(initial_len=N) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 34; __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 = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_V + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 34; __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 = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_initial_len, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 34; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__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_4cdec_2sa_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":36 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":36 * self.ha = IntList(initial_len=V+1) * * isa = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -34649,18 +36557,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o * */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 36; __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 = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 36; __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 = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_initial_len, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 36; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_isa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":37 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":37 * * isa = IntList(initial_len=N) * word_count = IntList(initial_len=V+1) # <<<<<<<<<<<<<< @@ -34668,34 +36576,34 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o * '''Step 1: bucket sort data''' */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; __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 = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_V + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; __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 = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_initial_len, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_word_count = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":40 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":40 * * '''Step 1: bucket sort data''' * cdef float sort_start_time = monitor_cpu() # <<<<<<<<<<<<<< * cdef float start_time = sort_start_time * for i from 0 <= i < N: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); 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_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sort_start_time = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":41 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":41 * '''Step 1: bucket sort data''' * cdef float sort_start_time = monitor_cpu() * cdef float start_time = sort_start_time # <<<<<<<<<<<<<< @@ -34704,7 +36612,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_start_time = __pyx_v_sort_start_time; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":42 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":42 * cdef float sort_start_time = monitor_cpu() * cdef float start_time = sort_start_time * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -34714,7 +36622,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_5 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":43 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":43 * cdef float start_time = sort_start_time * for i from 0 <= i < N: * a_i = self.darray.data.arr[i] # <<<<<<<<<<<<<< @@ -34723,7 +36631,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":44 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":44 * for i from 0 <= i < N: * a_i = self.darray.data.arr[i] * word_count.arr[a_i] = word_count.arr[a_i] + 1 # <<<<<<<<<<<<<< @@ -34733,7 +36641,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o (__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":46 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":46 * word_count.arr[a_i] = word_count.arr[a_i] + 1 * * n = 0 # <<<<<<<<<<<<<< @@ -34742,7 +36650,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_n = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":47 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":47 * * n = 0 * for i from 0 <= i < V+1: # <<<<<<<<<<<<<< @@ -34752,7 +36660,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_6 = (__pyx_v_V + 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":48 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":48 * n = 0 * for i from 0 <= i < V+1: * self.ha.arr[i] = n # <<<<<<<<<<<<<< @@ -34761,7 +36669,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ (__pyx_v_self->ha->arr[__pyx_v_i]) = __pyx_v_n; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":49 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":49 * for i from 0 <= i < V+1: * self.ha.arr[i] = n * n = n + word_count.arr[i] # <<<<<<<<<<<<<< @@ -34770,7 +36678,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_n = (__pyx_v_n + (__pyx_v_word_count->arr[__pyx_v_i])); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":50 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":50 * self.ha.arr[i] = n * n = n + word_count.arr[i] * word_count.arr[i] = 0 # <<<<<<<<<<<<<< @@ -34780,7 +36688,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o (__pyx_v_word_count->arr[__pyx_v_i]) = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":52 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":52 * word_count.arr[i] = 0 * * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -34790,7 +36698,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_5 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":53 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":53 * * for i from 0 <= i < N: * a_i = self.darray.data.arr[i] # <<<<<<<<<<<<<< @@ -34799,7 +36707,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":54 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":54 * for i from 0 <= i < N: * a_i = self.darray.data.arr[i] * self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i # <<<<<<<<<<<<<< @@ -34808,7 +36716,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ (__pyx_v_self->sa->arr[((__pyx_v_self->ha->arr[__pyx_v_a_i]) + (__pyx_v_word_count->arr[__pyx_v_a_i]))]) = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":55 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":55 * a_i = self.darray.data.arr[i] * self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i * isa.arr[i] = self.ha.arr[a_i + 1] - 1 # bucket pointer is last index in bucket # <<<<<<<<<<<<<< @@ -34817,7 +36725,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ (__pyx_v_isa->arr[__pyx_v_i]) = ((__pyx_v_self->ha->arr[(__pyx_v_a_i + 1)]) - 1); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":56 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":56 * self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i * isa.arr[i] = self.ha.arr[a_i + 1] - 1 # bucket pointer is last index in bucket * word_count.arr[a_i] = word_count.arr[a_i] + 1 # <<<<<<<<<<<<<< @@ -34827,7 +36735,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o (__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":59 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":59 * * '''Determine size of initial runs''' * current_run = 0 # <<<<<<<<<<<<<< @@ -34836,7 +36744,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_current_run = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":60 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":60 * '''Determine size of initial runs''' * current_run = 0 * for i from 0 <= i < V+1: # <<<<<<<<<<<<<< @@ -34846,7 +36754,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_6 = (__pyx_v_V + 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":61 * current_run = 0 * for i from 0 <= i < V+1: * if i < V and self.ha.arr[i+1] - self.ha.arr[i] == 1: # <<<<<<<<<<<<<< @@ -34862,7 +36770,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o } if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":62 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":62 * for i from 0 <= i < V+1: * if i < V and self.ha.arr[i+1] - self.ha.arr[i] == 1: * current_run = current_run + 1 # <<<<<<<<<<<<<< @@ -34874,7 +36782,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":64 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":64 * current_run = current_run + 1 * else: * if current_run > 0: # <<<<<<<<<<<<<< @@ -34884,7 +36792,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_9 = ((__pyx_v_current_run > 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":65 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":65 * else: * if current_run > 0: * self.sa.arr[self.ha.arr[i] - current_run] = -current_run # <<<<<<<<<<<<<< @@ -34893,7 +36801,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ (__pyx_v_self->sa->arr[((__pyx_v_self->ha->arr[__pyx_v_i]) - __pyx_v_current_run)]) = (-__pyx_v_current_run); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":66 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":66 * if current_run > 0: * self.sa.arr[self.ha.arr[i] - current_run] = -current_run * current_run = 0 # <<<<<<<<<<<<<< @@ -34908,21 +36816,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_L11:; } - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":68 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":68 * current_run = 0 * * logger.info(" Bucket sort took %f seconds", (monitor_cpu() - sort_start_time)) # <<<<<<<<<<<<<< * * '''Step 2: prefix-doubling sort''' */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyFloat_FromDouble(__pyx_v_sort_start_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -34933,19 +36841,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_91)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_91)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_91)); + __Pyx_INCREF(__pyx_kp_s_Bucket_sort_took_f_seconds); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_Bucket_sort_took_f_seconds); + __Pyx_GIVEREF(__pyx_kp_s_Bucket_sort_took_f_seconds); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":71 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":71 * * '''Step 2: prefix-doubling sort''' * h = 1 # <<<<<<<<<<<<<< @@ -34954,7 +36862,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_h = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":72 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":72 * '''Step 2: prefix-doubling sort''' * h = 1 * while self.sa.arr[0] != -N: # <<<<<<<<<<<<<< @@ -34965,51 +36873,51 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_9 = (((__pyx_v_self->sa->arr[0]) != (-__pyx_v_N)) != 0); if (!__pyx_t_9) break; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":73 * h = 1 * while self.sa.arr[0] != -N: * sort_start_time = monitor_cpu() # <<<<<<<<<<<<<< * logger.debug(" Refining, sort depth = %d", h) * i = 0 */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sort_start_time = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":74 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":74 * while self.sa.arr[0] != -N: * sort_start_time = monitor_cpu() * logger.debug(" Refining, sort depth = %d", h) # <<<<<<<<<<<<<< * i = 0 * skip = 0 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__debug); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_debug); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __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[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_92)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_92)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_92)); + __Pyx_INCREF(__pyx_kp_s_Refining_sort_depth_d); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_Refining_sort_depth_d); + __Pyx_GIVEREF(__pyx_kp_s_Refining_sort_depth_d); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":75 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":75 * sort_start_time = monitor_cpu() * logger.debug(" Refining, sort depth = %d", h) * i = 0 # <<<<<<<<<<<<<< @@ -35018,7 +36926,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_i = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":76 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":76 * logger.debug(" Refining, sort depth = %d", h) * i = 0 * skip = 0 # <<<<<<<<<<<<<< @@ -35027,7 +36935,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_skip = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":77 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":77 * i = 0 * skip = 0 * while i < N: # <<<<<<<<<<<<<< @@ -35038,7 +36946,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_9 = ((__pyx_v_i < __pyx_v_N) != 0); if (!__pyx_t_9) break; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":78 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":78 * skip = 0 * while i < N: * if self.sa.arr[i] < 0: # <<<<<<<<<<<<<< @@ -35048,7 +36956,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_9 = (((__pyx_v_self->sa->arr[__pyx_v_i]) < 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":79 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":79 * while i < N: * if self.sa.arr[i] < 0: * skip = skip + self.sa.arr[i] # <<<<<<<<<<<<<< @@ -35057,7 +36965,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_skip = (__pyx_v_skip + (__pyx_v_self->sa->arr[__pyx_v_i])); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":80 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":80 * if self.sa.arr[i] < 0: * skip = skip + self.sa.arr[i] * i = i - self.sa.arr[i] # <<<<<<<<<<<<<< @@ -35069,7 +36977,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":82 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":82 * i = i - self.sa.arr[i] * else: * if skip < 0: # <<<<<<<<<<<<<< @@ -35079,7 +36987,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_9 = ((__pyx_v_skip < 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":83 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":83 * else: * if skip < 0: * self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<< @@ -35088,7 +36996,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ (__pyx_v_self->sa->arr[(__pyx_v_i + __pyx_v_skip)]) = __pyx_v_skip; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":84 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":84 * if skip < 0: * self.sa.arr[i+skip] = skip * skip = 0 # <<<<<<<<<<<<<< @@ -35100,7 +37008,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o } __pyx_L18:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":85 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":85 * self.sa.arr[i+skip] = skip * skip = 0 * j = isa.arr[self.sa.arr[i]] # <<<<<<<<<<<<<< @@ -35109,20 +37017,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_j = (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":86 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":86 * skip = 0 * j = isa.arr[self.sa.arr[i]] * self.q3sort(i, j, h, isa) # <<<<<<<<<<<<<< * i = j+1 * if skip < 0: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_q3sort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); @@ -35138,13 +37046,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_2 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __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_12)); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":87 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":87 * j = isa.arr[self.sa.arr[i]] * self.q3sort(i, j, h, isa) * i = j+1 # <<<<<<<<<<<<<< @@ -35156,7 +37064,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_L17:; } - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":88 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":88 * self.q3sort(i, j, h, isa) * i = j+1 * if skip < 0: # <<<<<<<<<<<<<< @@ -35166,7 +37074,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_9 = ((__pyx_v_skip < 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":89 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":89 * i = j+1 * if skip < 0: * self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<< @@ -35178,7 +37086,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o } __pyx_L19:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":90 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":90 * if skip < 0: * self.sa.arr[i+skip] = skip * h = h * 2 # <<<<<<<<<<<<<< @@ -35187,21 +37095,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_h = (__pyx_v_h * 2); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":91 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":91 * self.sa.arr[i+skip] = skip * h = h * 2 * logger.debug(" Refinement took %f seconds", (monitor_cpu() - sort_start_time)) # <<<<<<<<<<<<<< * * '''Step 3: read off suffix array from inverse suffix array''' */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__debug); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_debug); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyFloat_FromDouble(__pyx_v_sort_start_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -35212,37 +37120,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_93)); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_kp_s_93)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_93)); + __Pyx_INCREF(__pyx_kp_s_Refinement_took_f_seconds); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_s_Refinement_took_f_seconds); + __Pyx_GIVEREF(__pyx_kp_s_Refinement_took_f_seconds); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":94 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":94 * * '''Step 3: read off suffix array from inverse suffix array''' * logger.info(" Finalizing sort...") # <<<<<<<<<<<<<< * for i from 0 <= i < N: * j = isa.arr[i] */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s__info); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_info); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_k_tuple_95), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":95 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":95 * '''Step 3: read off suffix array from inverse suffix array''' * logger.info(" Finalizing sort...") * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -35252,7 +37160,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __pyx_t_5 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":96 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":96 * logger.info(" Finalizing sort...") * for i from 0 <= i < N: * j = isa.arr[i] # <<<<<<<<<<<<<< @@ -35261,7 +37169,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o */ __pyx_v_j = (__pyx_v_isa->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":97 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":97 * for i from 0 <= i < N: * j = isa.arr[i] * self.sa.arr[j] = i # <<<<<<<<<<<<<< @@ -35271,21 +37179,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o (__pyx_v_self->sa->arr[__pyx_v_j]) = __pyx_v_i; } - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":98 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":98 * j = isa.arr[i] * self.sa.arr[j] = i * logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time)) # <<<<<<<<<<<<<< * * def q3sort(self, int i, int j, int h, IntList isa, pad=""): */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s__info); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_info); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyFloat_FromDouble(__pyx_v_start_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -35296,18 +37204,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_96)); - PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_kp_s_96)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_96)); + __Pyx_INCREF(__pyx_kp_s_Suffix_array_construction_took_f); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_kp_s_Suffix_array_construction_took_f); + __Pyx_GIVEREF(__pyx_kp_s_Suffix_array_construction_took_f); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":23 + * return self.sa.arr[i] + * + * def read_text(self, filename, side): # <<<<<<<<<<<<<< + * '''Constructs suffix array using the algorithm + * of Larsson & Sadahkane (1999)''' + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -35326,6 +37243,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":100 + * logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time)) + * + * def q3sort(self, int i, int j, int h, IntList isa, pad=""): # <<<<<<<<<<<<<< + * '''This is a ternary quicksort. It divides the array into + * three partitions: items less than the pivot, items equal + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4cdec_2sa_3_sa_11SuffixArray_6q3sort[] = "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"; @@ -35342,9 +37267,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v __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}; + 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_47); + values[4] = ((PyObject *)__pyx_kp_s__32); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); @@ -35360,26 +37285,26 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) 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 = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__h)) != 0)) 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 = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__isa)) != 0)) 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 = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pad); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pad); if (value) { values[4] = value; kw_args--; } } } @@ -35397,9 +37322,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v 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 = 100; __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 = 100; __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 = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_j = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_j == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_h = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_h == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_isa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)values[3]); __pyx_v_pad = values[4]; } @@ -35413,6 +37338,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isa), __pyx_ptype_4cdec_2sa_3_sa_IntList, 1, "isa", 0))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_i, __pyx_v_j, __pyx_v_h, __pyx_v_isa, __pyx_v_pad); + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -35421,14 +37348,6 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":100 - * logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time)) - * - * def q3sort(self, int i, int j, int h, IntList isa, pad=""): # <<<<<<<<<<<<<< - * '''This is a ternary quicksort. It divides the array into - * three partitions: items less than the pivot, items equal - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, int __pyx_v_h, struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_isa, PyObject *__pyx_v_pad) { int __pyx_v_k; int __pyx_v_midpoint; @@ -35451,7 +37370,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("q3sort", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":107 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":107 * cdef int k, midpoint, pval, phead, ptail, tmp * * if j-i < -1: # <<<<<<<<<<<<<< @@ -35461,16 +37380,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_1 = (((__pyx_v_j - __pyx_v_i) < -1) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":108 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":108 * * if j-i < -1: * raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j)) # <<<<<<<<<<<<<< * 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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -35480,25 +37399,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_97), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __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_3 = __Pyx_PyString_Format(__pyx_kp_s_Unexpected_condition_found_in_q3, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __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)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":109 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":109 * if j-i < -1: * raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j)) * if j-i == -1: # recursive base case -- empty interval # <<<<<<<<<<<<<< @@ -35508,7 +37425,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_1 = (((__pyx_v_j - __pyx_v_i) == -1) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":110 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":110 * raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j)) * if j-i == -1: # recursive base case -- empty interval * return # <<<<<<<<<<<<<< @@ -35518,11 +37435,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":111 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":111 * if j-i == -1: # recursive base case -- empty interval * return * if (j-i == 0): # recursive base case -- singleton interval # <<<<<<<<<<<<<< @@ -35532,7 +37447,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_1 = (((__pyx_v_j - __pyx_v_i) == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":112 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":112 * return * if (j-i == 0): # recursive base case -- singleton interval * isa.arr[self.sa.arr[i]] = i # <<<<<<<<<<<<<< @@ -35541,7 +37456,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]) = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":113 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":113 * if (j-i == 0): # recursive base case -- singleton interval * isa.arr[self.sa.arr[i]] = i * self.sa.arr[i] = -1 # <<<<<<<<<<<<<< @@ -35550,7 +37465,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ (__pyx_v_self->sa->arr[__pyx_v_i]) = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":114 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":114 * isa.arr[self.sa.arr[i]] = i * self.sa.arr[i] = -1 * return # <<<<<<<<<<<<<< @@ -35560,11 +37475,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L5; } - __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":123 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":123 * # If the method of assigning word_id's is changed, this method * # may need to be reconsidered as well. * midpoint = (i+j)/2 # <<<<<<<<<<<<<< @@ -35573,7 +37486,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":124 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":124 * # may need to be reconsidered as well. * midpoint = (i+j)/2 * pval = isa.arr[self.sa.arr[midpoint] + h] # <<<<<<<<<<<<<< @@ -35582,7 +37495,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ __pyx_v_pval = (__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_h)]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":125 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":125 * midpoint = (i+j)/2 * pval = isa.arr[self.sa.arr[midpoint] + h] * if i != midpoint: # <<<<<<<<<<<<<< @@ -35592,7 +37505,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_i != __pyx_v_midpoint) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":126 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":126 * pval = isa.arr[self.sa.arr[midpoint] + h] * if i != midpoint: * tmp = self.sa.arr[midpoint] # <<<<<<<<<<<<<< @@ -35601,7 +37514,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ __pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_midpoint]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":127 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":127 * if i != midpoint: * tmp = self.sa.arr[midpoint] * self.sa.arr[midpoint] = self.sa.arr[i] # <<<<<<<<<<<<<< @@ -35610,7 +37523,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ (__pyx_v_self->sa->arr[__pyx_v_midpoint]) = (__pyx_v_self->sa->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":128 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":128 * tmp = self.sa.arr[midpoint] * self.sa.arr[midpoint] = self.sa.arr[i] * self.sa.arr[i] = tmp # <<<<<<<<<<<<<< @@ -35622,7 +37535,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":129 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":129 * self.sa.arr[midpoint] = self.sa.arr[i] * self.sa.arr[i] = tmp * phead = i # <<<<<<<<<<<<<< @@ -35631,7 +37544,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ __pyx_v_phead = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":130 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":130 * self.sa.arr[i] = tmp * phead = i * ptail = i # <<<<<<<<<<<<<< @@ -35640,7 +37553,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ __pyx_v_ptail = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":134 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":134 * # find the three partitions. phead marks the first element * # of the middle partition, and ptail marks the last element * for k from i+1 <= k < j+1: # <<<<<<<<<<<<<< @@ -35650,7 +37563,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_5 = (__pyx_v_j + 1); for (__pyx_v_k = (__pyx_v_i + 1); __pyx_v_k < __pyx_t_5; __pyx_v_k++) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":135 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":135 * # of the middle partition, and ptail marks the last element * for k from i+1 <= k < j+1: * if isa.arr[self.sa.arr[k] + h] < pval: # <<<<<<<<<<<<<< @@ -35660,7 +37573,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_1 = (((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) < __pyx_v_pval) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":136 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":136 * for k from i+1 <= k < j+1: * if isa.arr[self.sa.arr[k] + h] < pval: * if k > ptail+1: # <<<<<<<<<<<<<< @@ -35670,7 +37583,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_k > (__pyx_v_ptail + 1)) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":137 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":137 * if isa.arr[self.sa.arr[k] + h] < pval: * if k > ptail+1: * tmp = self.sa.arr[phead] # <<<<<<<<<<<<<< @@ -35679,7 +37592,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ __pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":138 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":138 * if k > ptail+1: * tmp = self.sa.arr[phead] * self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<< @@ -35688,7 +37601,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ (__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":139 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":139 * tmp = self.sa.arr[phead] * self.sa.arr[phead] = self.sa.arr[k] * self.sa.arr[k] = self.sa.arr[ptail+1] # <<<<<<<<<<<<<< @@ -35697,7 +37610,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ (__pyx_v_self->sa->arr[__pyx_v_k]) = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":140 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":140 * self.sa.arr[phead] = self.sa.arr[k] * self.sa.arr[k] = self.sa.arr[ptail+1] * self.sa.arr[ptail+1] = tmp # <<<<<<<<<<<<<< @@ -35709,7 +37622,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":142 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":142 * self.sa.arr[ptail+1] = tmp * else: # k == ptail+1 * tmp = self.sa.arr[phead] # <<<<<<<<<<<<<< @@ -35718,7 +37631,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ __pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":143 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":143 * else: # k == ptail+1 * tmp = self.sa.arr[phead] * self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<< @@ -35727,7 +37640,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ (__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":144 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":144 * tmp = self.sa.arr[phead] * self.sa.arr[phead] = self.sa.arr[k] * self.sa.arr[k] = tmp # <<<<<<<<<<<<<< @@ -35738,7 +37651,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ } __pyx_L10:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":145 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":145 * self.sa.arr[phead] = self.sa.arr[k] * self.sa.arr[k] = tmp * phead = phead + 1 # <<<<<<<<<<<<<< @@ -35747,7 +37660,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ __pyx_v_phead = (__pyx_v_phead + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":146 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":146 * self.sa.arr[k] = tmp * phead = phead + 1 * ptail = ptail + 1 # <<<<<<<<<<<<<< @@ -35759,7 +37672,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":148 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":148 * ptail = ptail + 1 * else: * if isa.arr[self.sa.arr[k] + h] == pval: # <<<<<<<<<<<<<< @@ -35769,7 +37682,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_1 = (((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) == __pyx_v_pval) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":149 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":149 * else: * if isa.arr[self.sa.arr[k] + h] == pval: * if k > ptail+1: # <<<<<<<<<<<<<< @@ -35779,7 +37692,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_k > (__pyx_v_ptail + 1)) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":150 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":150 * if isa.arr[self.sa.arr[k] + h] == pval: * if k > ptail+1: * tmp = self.sa.arr[ptail+1] # <<<<<<<<<<<<<< @@ -35788,7 +37701,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ __pyx_v_tmp = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":151 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":151 * if k > ptail+1: * tmp = self.sa.arr[ptail+1] * self.sa.arr[ptail+1] = self.sa.arr[k] # <<<<<<<<<<<<<< @@ -35797,7 +37710,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ */ (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]) = (__pyx_v_self->sa->arr[__pyx_v_k]); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":152 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":152 * tmp = self.sa.arr[ptail+1] * self.sa.arr[ptail+1] = self.sa.arr[k] * self.sa.arr[k] = tmp # <<<<<<<<<<<<<< @@ -35809,7 +37722,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ } __pyx_L12:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":153 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":153 * self.sa.arr[ptail+1] = self.sa.arr[k] * self.sa.arr[k] = tmp * ptail = ptail + 1 # <<<<<<<<<<<<<< @@ -35824,22 +37737,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_L9:; } - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":156 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":156 * * # recursively sort smaller suffixes * self.q3sort(i, phead-1, h, isa, pad+" ") # <<<<<<<<<<<<<< * * # update suffixes with pivot value */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_q3sort); if (unlikely(!__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 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_phead - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_50)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_v_pad, __pyx_kp_s__34); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); @@ -35858,13 +37771,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __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_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":160 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":160 * # update suffixes with pivot value * # corresponds to update_group function in Larsson & Sadakane * for k from phead <= k < ptail+1: # <<<<<<<<<<<<<< @@ -35874,7 +37787,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_5 = (__pyx_v_ptail + 1); for (__pyx_v_k = __pyx_v_phead; __pyx_v_k < __pyx_t_5; __pyx_v_k++) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":161 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":161 * # corresponds to update_group function in Larsson & Sadakane * for k from phead <= k < ptail+1: * isa.arr[self.sa.arr[k]] = ptail # <<<<<<<<<<<<<< @@ -35884,7 +37797,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_k])]) = __pyx_v_ptail; } - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":162 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":162 * for k from phead <= k < ptail+1: * isa.arr[self.sa.arr[k]] = ptail * if phead == ptail: # <<<<<<<<<<<<<< @@ -35894,7 +37807,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_phead == __pyx_v_ptail) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":163 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":163 * isa.arr[self.sa.arr[k]] = ptail * if phead == ptail: * self.sa.arr[phead] = -1 # <<<<<<<<<<<<<< @@ -35906,22 +37819,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ } __pyx_L15:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":166 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":166 * * # recursively sort larger suffixes * self.q3sort(ptail+1, j, h, isa, pad+" ") # <<<<<<<<<<<<<< * * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_q3sort); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __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 = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_From_long((__pyx_v_ptail + 1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __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 = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __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 = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_50)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_pad, __pyx_kp_s__34); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __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 = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -35940,12 +37853,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ __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 = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __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; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":100 + * logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time)) + * + * def q3sort(self, int i, int j, int h, IntList isa, pad=""): # <<<<<<<<<<<<<< + * '''This is a ternary quicksort. It divides the array into + * three partitions: items less than the pivot, items equal + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -35963,6 +37885,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":169 + * + * + * def write_text(self, char* filename): # <<<<<<<<<<<<<< + * self.darray.write_text(filename) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_9write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_9write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -35983,18 +37913,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_9write_text(PyObject *__p return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11SuffixArray_8write_text(((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":169 - * - * - * def write_text(self, char* filename): # <<<<<<<<<<<<<< - * self.darray.write_text(filename) - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_8write_text(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -36006,28 +37930,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_8write_text(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":170 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":170 * * def write_text(self, char* filename): * self.darray.write_text(filename) # <<<<<<<<<<<<<< * * def read_binary(self, char* filename): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__write_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->darray), __pyx_n_s_write_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __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)); + 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[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":169 + * + * + * def write_text(self, char* filename): # <<<<<<<<<<<<<< + * self.darray.write_text(filename) + * + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -36042,6 +37975,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_8write_text(struct __pyx_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":172 + * self.darray.write_text(filename) + * + * def read_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE *f + * f = fopen(filename, "r") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_11read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_11read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -36062,34 +38003,28 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_11read_binary(PyObject *_ return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":172 - * self.darray.write_text(filename) - * - * def read_binary(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE *f - * f = fopen(filename, "r") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":174 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":174 * def read_binary(self, char* filename): * cdef FILE *f * f = fopen(filename, "r") # <<<<<<<<<<<<<< * self.darray.read_handle(f) * self.sa.read_handle(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":175 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":175 * cdef FILE *f * f = fopen(filename, "r") * self.darray.read_handle(f) # <<<<<<<<<<<<<< @@ -36098,7 +38033,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->read_handle(__pyx_v_self->darray, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":176 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":176 * f = fopen(filename, "r") * self.darray.read_handle(f) * self.sa.read_handle(f) # <<<<<<<<<<<<<< @@ -36107,7 +38042,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->read_handle(__pyx_v_self->sa, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":177 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":177 * self.darray.read_handle(f) * self.sa.read_handle(f) * self.ha.read_handle(f) # <<<<<<<<<<<<<< @@ -36116,7 +38051,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->read_handle(__pyx_v_self->ha, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":178 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":178 * self.sa.read_handle(f) * self.ha.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -36125,12 +38060,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":172 + * self.darray.write_text(filename) + * + * def read_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE *f + * f = fopen(filename, "r") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":180 + * fclose(f) + * + * def write_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_13write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_13write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -36151,34 +38103,28 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_13write_binary(PyObject * return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":180 - * fclose(f) - * - * def write_binary(self, char* filename): # <<<<<<<<<<<<<< - * cdef FILE* f - * f = fopen(filename, "w") - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":182 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":182 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< * self.darray.write_handle(f) * self.sa.write_handle(f) */ - __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); + __pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":183 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":183 * cdef FILE* f * f = fopen(filename, "w") * self.darray.write_handle(f) # <<<<<<<<<<<<<< @@ -36187,7 +38133,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->write_handle(__pyx_v_self->darray, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":184 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":184 * f = fopen(filename, "w") * self.darray.write_handle(f) * self.sa.write_handle(f) # <<<<<<<<<<<<<< @@ -36196,7 +38142,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->write_handle(__pyx_v_self->sa, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":185 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":185 * self.darray.write_handle(f) * self.sa.write_handle(f) * self.ha.write_handle(f) # <<<<<<<<<<<<<< @@ -36205,7 +38151,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->write_handle(__pyx_v_self->ha, __pyx_v_f); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":186 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":186 * self.sa.write_handle(f) * self.ha.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -36214,12 +38160,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p */ fclose(__pyx_v_f); + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":180 + * fclose(f) + * + * def write_binary(self, char* filename): # <<<<<<<<<<<<<< + * cdef FILE* f + * f = fopen(filename, "w") + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":188 + * fclose(f) + * + * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * self.darray.write_enhanced_handle(f) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_15write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_15write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { @@ -36240,18 +38203,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_15write_enhanced(PyObject return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":188 - * fclose(f) - * - * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< - * with open(filename, "w") as f: - * self.darray.write_enhanced_handle(f) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_a_i = NULL; @@ -36268,15 +38225,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; - PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":189 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":189 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -36285,23 +38242,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ */ /*with:*/ { __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __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)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__w)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_w); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_w); + __Pyx_GIVEREF(__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 = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __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 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __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 = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __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; @@ -36316,27 +38273,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":190 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":190 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * self.darray.write_enhanced_handle(f) # <<<<<<<<<<<<<< * for a_i in self.sa: * f.write("%d " % a_i) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->darray), __pyx_n_s_29); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->darray), __pyx_n_s_write_enhanced_handle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 190; __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 = 190; __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 = 190; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 190; __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; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":191 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":191 * with open(filename, "w") as f: * self.darray.write_enhanced_handle(f) * for a_i in self.sa: # <<<<<<<<<<<<<< @@ -36369,8 +38326,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ } 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(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -36380,45 +38338,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ __Pyx_XDECREF_SET(__pyx_v_a_i, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":192 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":192 * self.darray.write_enhanced_handle(f) * for a_i in self.sa: * f.write("%d " % a_i) # <<<<<<<<<<<<<< * f.write("\n") * for w_i in self.ha: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_v_a_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_v_a_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 192; __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)); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__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 = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 192; __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; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":193 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":193 * for a_i in self.sa: * f.write("%d " % a_i) * f.write("\n") # <<<<<<<<<<<<<< * for w_i in self.ha: * f.write("%d " % w_i) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_98), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 193; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":194 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":194 * f.write("%d " % a_i) * f.write("\n") * for w_i in self.ha: # <<<<<<<<<<<<<< @@ -36451,8 +38409,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ } 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(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; @@ -36462,40 +38421,40 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ __Pyx_XDECREF_SET(__pyx_v_w_i, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":195 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":195 * f.write("\n") * for w_i in self.ha: * f.write("%d " % w_i) # <<<<<<<<<<<<<< * f.write("\n") * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_v_w_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); + __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_v_w_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __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)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); + __Pyx_GIVEREF(__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 = 195; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __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; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":196 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":196 * for w_i in self.ha: * f.write("%d " % w_i) * f.write("\n") # <<<<<<<<<<<<<< * * cdef int __search_high(self, int word_id, int offset, int low, int high): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 196; __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; @@ -36510,7 +38469,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":189 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":189 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -36523,36 +38482,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ __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 = 189; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_2 = PyTuple_Pack(3, __pyx_t_10, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __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); - __Pyx_GIVEREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_12 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); + __pyx_t_11 = __Pyx_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 = 189; __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 (__pyx_t_11 < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __pyx_t_13 = ((!(__pyx_t_11 != 0)) != 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_12 < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__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 = 189; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - goto __pyx_L22; } - __pyx_L22:; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -36573,15 +38521,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ } } /*finally:*/ { - if (__pyx_t_3) { - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_100, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __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 (__pyx_t_13 < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*normal exit:*/{ + if (__pyx_t_3) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__59, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + goto __pyx_L6; } + __pyx_L6:; } goto __pyx_L23; __pyx_L3_error:; @@ -36590,6 +38540,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ __pyx_L23:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":188 + * fclose(f) + * + * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< + * with open(filename, "w") as f: + * self.darray.write_enhanced_handle(f) + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -36608,7 +38567,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _ return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":198 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":198 * f.write("\n") * * cdef int __search_high(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<< @@ -36623,7 +38582,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4 int __pyx_t_1; __Pyx_RefNannySetupContext("__search_high", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":201 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":201 * cdef int midpoint * * if low >= high: # <<<<<<<<<<<<<< @@ -36633,7 +38592,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4 __pyx_t_1 = ((__pyx_v_low >= __pyx_v_high) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":202 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":202 * * if low >= high: * return high # <<<<<<<<<<<<<< @@ -36642,11 +38601,9 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4 */ __pyx_r = __pyx_v_high; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":203 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":203 * if low >= high: * return high * midpoint = (high + low) / 2 # <<<<<<<<<<<<<< @@ -36655,7 +38612,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4 */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":204 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":204 * return high * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<< @@ -36665,7 +38622,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4 __pyx_t_1 = (((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":205 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":205 * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: * return self.__search_high(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<< @@ -36674,11 +38631,10 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4 */ __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_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; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":207 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":207 * return self.__search_high(word_id, offset, midpoint+1, high) * else: * return self.__search_high(word_id, offset, low, midpoint) # <<<<<<<<<<<<<< @@ -36688,15 +38644,22 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4 __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_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:; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":198 + * f.write("\n") + * + * cdef int __search_high(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<< + * cdef int midpoint + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":209 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":209 * return self.__search_high(word_id, offset, low, midpoint) * * cdef int __search_low(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<< @@ -36711,7 +38674,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c int __pyx_t_1; __Pyx_RefNannySetupContext("__search_low", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":212 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":212 * cdef int midpoint * * if low >= high: # <<<<<<<<<<<<<< @@ -36721,7 +38684,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c __pyx_t_1 = ((__pyx_v_low >= __pyx_v_high) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":213 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":213 * * if low >= high: * return high # <<<<<<<<<<<<<< @@ -36730,11 +38693,9 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c */ __pyx_r = __pyx_v_high; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":214 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":214 * if low >= high: * return high * midpoint = (high + low) / 2 # <<<<<<<<<<<<<< @@ -36743,7 +38704,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":215 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":215 * return high * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<< @@ -36753,7 +38714,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c __pyx_t_1 = (((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":216 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":216 * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: * return self.__search_low(word_id, offset, low, midpoint) # <<<<<<<<<<<<<< @@ -36762,11 +38723,10 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c */ __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_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; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":218 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":218 * return self.__search_low(word_id, offset, low, midpoint) * else: * return self.__search_low(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<< @@ -36776,15 +38736,22 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_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:; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":209 + * return self.__search_high(word_id, offset, low, midpoint) + * + * cdef int __search_low(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<< + * cdef int midpoint + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":220 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":220 * return self.__search_low(word_id, offset, midpoint+1, high) * * cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint): # <<<<<<<<<<<<<< @@ -36803,7 +38770,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get_range", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":221 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":221 * * cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint): * return (self.__search_low(word_id, offset, low, midpoint), # <<<<<<<<<<<<<< @@ -36811,18 +38778,26 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range(struct __pyx_o * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_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[12]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_4cdec_2sa_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[12]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":222 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":222 * cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint): * return (self.__search_low(word_id, offset, low, midpoint), * self.__search_high(word_id, offset, midpoint, high)) # <<<<<<<<<<<<<< * * cdef __lookup_helper(self, int word_id, int offset, int low, int high): */ - __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_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[12]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_4cdec_2sa_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[12]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":221 + * + * cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint): + * return (self.__search_low(word_id, offset, low, midpoint), # <<<<<<<<<<<<<< + * self.__search_high(word_id, offset, midpoint, high)) + * + */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -36831,12 +38806,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range(struct __pyx_o __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_r = ((PyObject *)__pyx_t_3); + __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":220 + * return self.__search_low(word_id, offset, midpoint+1, high) + * + * cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint): # <<<<<<<<<<<<<< + * return (self.__search_low(word_id, offset, low, midpoint), + * self.__search_high(word_id, offset, midpoint, high)) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -36849,7 +38831,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range(struct __pyx_o return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":224 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":224 * self.__search_high(word_id, offset, midpoint, high)) * * cdef __lookup_helper(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<< @@ -36870,7 +38852,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__lookup_helper", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":227 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":227 * cdef int midpoint * * if offset == 0: # <<<<<<<<<<<<<< @@ -36880,7 +38862,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p __pyx_t_1 = ((__pyx_v_offset == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":228 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":228 * * if offset == 0: * return (self.ha.arr[word_id], self.ha.arr[word_id+1]) # <<<<<<<<<<<<<< @@ -36888,9 +38870,9 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p * 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 = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->ha->arr[__pyx_v_word_id])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 228; __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 = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->ha->arr[(__pyx_v_word_id + 1)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 228; __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 = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -36900,14 +38882,12 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_r = ((PyObject *)__pyx_t_4); + __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":229 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":229 * if offset == 0: * return (self.ha.arr[word_id], self.ha.arr[word_id+1]) * if low >= high: # <<<<<<<<<<<<<< @@ -36917,7 +38897,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p __pyx_t_1 = ((__pyx_v_low >= __pyx_v_high) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":230 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":230 * return (self.ha.arr[word_id], self.ha.arr[word_id+1]) * if low >= high: * return None # <<<<<<<<<<<<<< @@ -36928,11 +38908,9 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":232 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":232 * return None * * midpoint = (high + low) / 2 # <<<<<<<<<<<<<< @@ -36941,7 +38919,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":233 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":233 * * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<< @@ -36951,7 +38929,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p __pyx_t_1 = (((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":234 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":234 * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: * return self.__get_range(word_id, offset, low, high, midpoint) # <<<<<<<<<<<<<< @@ -36964,11 +38942,9 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - goto __pyx_L5; } - __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":235 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":235 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: * return self.__get_range(word_id, offset, low, high, midpoint) * if self.darray.data.arr[self.sa.arr[midpoint] + offset] > word_id: # <<<<<<<<<<<<<< @@ -36978,7 +38954,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p __pyx_t_1 = (((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) > __pyx_v_word_id) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":236 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":236 * return self.__get_range(word_id, offset, low, high, midpoint) * if self.darray.data.arr[self.sa.arr[midpoint] + offset] > word_id: * return self.__lookup_helper(word_id, offset, low, midpoint) # <<<<<<<<<<<<<< @@ -36991,11 +38967,10 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - goto __pyx_L6; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":238 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":238 * return self.__lookup_helper(word_id, offset, low, midpoint) * else: * return self.__lookup_helper(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<< @@ -37009,10 +38984,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p __pyx_t_4 = 0; goto __pyx_L0; } - __pyx_L6:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":224 + * self.__search_high(word_id, offset, midpoint, high)) + * + * cdef __lookup_helper(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<< + * cdef int midpoint + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); @@ -37025,6 +39006,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":240 + * return self.__lookup_helper(word_id, offset, midpoint+1, high) + * + * def lookup(self, word, int offset, int low, int high): # <<<<<<<<<<<<<< + * cdef int wordid + * if low == -1: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_17lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_17lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -37039,7 +39028,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_17lookup(PyObject *__pyx_ __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}; + 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; @@ -37055,20 +39044,20 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_17lookup(PyObject *__pyx_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__word)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__offset)) != 0)) 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 = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low)) != 0)) 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 = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high)) != 0)) 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 = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -37085,9 +39074,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_17lookup(PyObject *__pyx_ 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 = 240; __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 = 240; __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 = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_offset = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_low = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_high = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; @@ -37098,18 +39087,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_17lookup(PyObject *__pyx_ return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_word, __pyx_v_offset, __pyx_v_low, __pyx_v_high); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":240 - * return self.__lookup_helper(word_id, offset, midpoint+1, high) - * - * def lookup(self, word, int offset, int low, int high): # <<<<<<<<<<<<<< - * cdef int wordid - * if low == -1: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj_4cdec_2sa_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; @@ -37124,7 +39107,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lookup", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":242 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":242 * def lookup(self, word, int offset, int low, int high): * cdef int wordid * if low == -1: # <<<<<<<<<<<<<< @@ -37134,7 +39117,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj __pyx_t_1 = ((__pyx_v_low == -1) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":243 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":243 * cdef int wordid * if low == -1: * low = 0 # <<<<<<<<<<<<<< @@ -37146,7 +39129,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":244 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":244 * if low == -1: * low = 0 * if high == -1: # <<<<<<<<<<<<<< @@ -37156,7 +39139,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj __pyx_t_1 = ((__pyx_v_high == -1) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":245 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":245 * low = 0 * if high == -1: * high = len(self.sa) # <<<<<<<<<<<<<< @@ -37172,7 +39155,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":246 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":246 * if high == -1: * high = len(self.sa) * if word in self.darray.word2id: # <<<<<<<<<<<<<< @@ -37183,19 +39166,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":247 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":247 * high = len(self.sa) * if word in self.darray.word2id: * word_id = self.darray.word2id[word] # <<<<<<<<<<<<<< * 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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_self->darray->word2id, __pyx_v_word); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_v_word_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":248 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":248 * if word in self.darray.word2id: * word_id = self.darray.word2id[word] * return self.__lookup_helper(word_id, offset, low, high) # <<<<<<<<<<<<<< @@ -37203,17 +39186,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj * return None */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_word_id); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_t_5, __pyx_v_offset, __pyx_v_low, __pyx_v_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - goto __pyx_L5; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":250 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":250 * return self.__lookup_helper(word_id, offset, low, high) * else: * return None # <<<<<<<<<<<<<< @@ -37223,10 +39205,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj __pyx_r = Py_None; goto __pyx_L0; } - __pyx_L5:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":240 + * return self.__lookup_helper(word_id, offset, midpoint+1, high) + * + * def lookup(self, word, int offset, int low, int high): # <<<<<<<<<<<<<< + * cdef int wordid + * if low == -1: + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cdec.sa._sa.SuffixArray.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -37238,6 +39226,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":43 + * cdef public phrases_al + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * # Keep track of everything that can be sampled: + * self.samples_f = defaultdict(int) + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -37248,10 +39244,20 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_1__cinit__(PyObject *__pyx_v_se __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_4cdec_2sa_3_sa_11OnlineStats___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":50 + * self.phrases_f = defaultdict(int) + * self.phrases_e = defaultdict(int) + * self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< + * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1, METH_NOARGS, __Pyx_DOCSTR(0)}; @@ -37260,18 +39266,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1(PyObje __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":50 - * self.phrases_f = defaultdict(int) - * self.phrases_e = defaultdict(int) - * self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< - * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) - * - */ - static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -37283,23 +39283,22 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda1", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __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 = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -37312,6 +39311,14 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":51 + * self.phrases_e = defaultdict(int) + * self.phrases_fe = defaultdict(lambda: defaultdict(int)) + * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<< + * + * cdef int PRECOMPUTE = 0 + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2 = {__Pyx_NAMESTR("lambda2"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2, METH_NOARGS, __Pyx_DOCSTR(0)}; @@ -37320,18 +39327,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2(PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":51 - * self.phrases_e = defaultdict(int) - * self.phrases_fe = defaultdict(lambda: defaultdict(int)) - * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<< - * - * cdef int PRECOMPUTE = 0 - */ - static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -37343,23 +39344,22 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda2", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyTuple_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyTuple_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyTuple_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -37372,7 +39372,7 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":43 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":43 * cdef public phrases_al * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -37391,130 +39391,139 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":45 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":45 * def __cinit__(self): * # Keep track of everything that can be sampled: * self.samples_f = defaultdict(int) # <<<<<<<<<<<<<< * * # Phrase counts */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 45; __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 = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->samples_f); __Pyx_DECREF(__pyx_v_self->samples_f); __pyx_v_self->samples_f = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":48 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":48 * * # Phrase counts * self.phrases_f = defaultdict(int) # <<<<<<<<<<<<<< * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->phrases_f); __Pyx_DECREF(__pyx_v_self->phrases_f); __pyx_v_self->phrases_f = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":49 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":49 * # Phrase counts * self.phrases_f = defaultdict(int) * self.phrases_e = defaultdict(int) # <<<<<<<<<<<<<< * self.phrases_fe = defaultdict(lambda: defaultdict(int)) * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 49; __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 = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 49; __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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->phrases_e); __Pyx_DECREF(__pyx_v_self->phrases_e); __pyx_v_self->phrases_e = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":50 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":50 * self.phrases_f = defaultdict(int) * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1, 0, __pyx_n_s_cinit___locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __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 = 50; __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_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __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_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->phrases_fe); __Pyx_DECREF(__pyx_v_self->phrases_fe); __pyx_v_self->phrases_fe = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":51 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":51 * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<< * * cdef int PRECOMPUTE = 0 */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2, 0, __pyx_n_s_cinit___locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __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[8]; __pyx_lineno = 51; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->phrases_al); __Pyx_DECREF(__pyx_v_self->phrases_al); __pyx_v_self->phrases_al = __pyx_t_1; __pyx_t_1 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":43 + * cdef public phrases_al + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * # Keep track of everything that can be sampled: + * self.samples_f = defaultdict(int) + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -37528,6 +39537,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":37 + * + * cdef class OnlineStats: + * cdef public samples_f # <<<<<<<<<<<<<< + * cdef public phrases_f + * cdef public phrases_e + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_1__get__(PyObject *__pyx_v_self) { @@ -37535,18 +39552,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_1__get__(PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":37 - * - * cdef class OnlineStats: - * cdef public samples_f # <<<<<<<<<<<<<< - * cdef public phrases_f - * cdef public phrases_e - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -37556,7 +39567,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f___get__(struct __pyx_r = __pyx_v_self->samples_f; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -37570,6 +39581,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_3__set__(PyObject *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37584,6 +39597,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f_2__set__(struct __py __Pyx_DECREF(__pyx_v_self->samples_f); __pyx_v_self->samples_f = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -37596,6 +39610,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_5__del__(PyObject *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37610,11 +39626,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f_4__del__(struct __py __Pyx_DECREF(__pyx_v_self->samples_f); __pyx_v_self->samples_f = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":38 + * cdef class OnlineStats: + * cdef public samples_f + * cdef public phrases_f # <<<<<<<<<<<<<< + * cdef public phrases_e + * cdef public phrases_fe + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_1__get__(PyObject *__pyx_v_self) { @@ -37622,18 +39647,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_1__get__(PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_f___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":38 - * cdef class OnlineStats: - * cdef public samples_f - * cdef public phrases_f # <<<<<<<<<<<<<< - * cdef public phrases_e - * cdef public phrases_fe - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_f___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -37643,7 +39662,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_f___get__(struct __pyx_r = __pyx_v_self->phrases_f; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -37657,6 +39676,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_3__set__(PyObject *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37671,6 +39692,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_2__set__(struct __py __Pyx_DECREF(__pyx_v_self->phrases_f); __pyx_v_self->phrases_f = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -37683,6 +39705,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_5__del__(PyObject *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37697,11 +39721,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_4__del__(struct __py __Pyx_DECREF(__pyx_v_self->phrases_f); __pyx_v_self->phrases_f = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":39 + * cdef public samples_f + * cdef public phrases_f + * cdef public phrases_e # <<<<<<<<<<<<<< + * cdef public phrases_fe + * cdef public phrases_al + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_1__get__(PyObject *__pyx_v_self) { @@ -37709,18 +39742,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_1__get__(PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_e___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":39 - * cdef public samples_f - * cdef public phrases_f - * cdef public phrases_e # <<<<<<<<<<<<<< - * cdef public phrases_fe - * cdef public phrases_al - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_e___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -37730,7 +39757,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_e___get__(struct __pyx_r = __pyx_v_self->phrases_e; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -37744,6 +39771,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_3__set__(PyObject *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37758,6 +39787,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_2__set__(struct __py __Pyx_DECREF(__pyx_v_self->phrases_e); __pyx_v_self->phrases_e = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -37770,6 +39800,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_5__del__(PyObject *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37784,11 +39816,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_4__del__(struct __py __Pyx_DECREF(__pyx_v_self->phrases_e); __pyx_v_self->phrases_e = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":40 + * cdef public phrases_f + * cdef public phrases_e + * cdef public phrases_fe # <<<<<<<<<<<<<< + * cdef public phrases_al + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_1__get__(PyObject *__pyx_v_self) { @@ -37796,18 +39837,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_1__get__(PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":40 - * cdef public phrases_f - * cdef public phrases_e - * cdef public phrases_fe # <<<<<<<<<<<<<< - * cdef public phrases_al - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -37817,7 +39852,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe___get__(stru __pyx_r = __pyx_v_self->phrases_fe; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -37831,6 +39866,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_3__set__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37845,6 +39882,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_2__set__(struct __ __Pyx_DECREF(__pyx_v_self->phrases_fe); __pyx_v_self->phrases_fe = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -37857,6 +39895,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_5__del__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37871,11 +39911,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_4__del__(struct __ __Pyx_DECREF(__pyx_v_self->phrases_fe); __pyx_v_self->phrases_fe = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":41 + * cdef public phrases_e + * cdef public phrases_fe + * cdef public phrases_al # <<<<<<<<<<<<<< + * + * def __cinit__(self): + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_1__get__(PyObject *__pyx_v_self) { @@ -37883,18 +39932,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_1__get__(PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":41 - * cdef public phrases_e - * cdef public phrases_fe - * cdef public phrases_al # <<<<<<<<<<<<<< - * - * def __cinit__(self): - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -37904,7 +39947,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al___get__(stru __pyx_r = __pyx_v_self->phrases_al; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -37918,6 +39961,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_3__set__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37932,6 +39977,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_2__set__(struct __ __Pyx_DECREF(__pyx_v_self->phrases_al); __pyx_v_self->phrases_al = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -37944,6 +39990,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_5__del__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37958,11 +40006,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_4__del__(struct __ __Pyx_DECREF(__pyx_v_self->phrases_al); __pyx_v_self->phrases_al = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":63 + * cdef public children + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.children = {} + * + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -37973,18 +40030,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, __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_4cdec_2sa_3_sa_8TrieNode___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":63 - * cdef public children - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.children = {} - * - */ - static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations @@ -37994,7 +40045,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":64 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":64 * * def __cinit__(self): * self.children = {} # <<<<<<<<<<<<<< @@ -38002,13 +40053,22 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2s * cdef class ExtendedTrieNode(TrieNode): */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->children); __Pyx_DECREF(__pyx_v_self->children); - __pyx_v_self->children = ((PyObject *)__pyx_t_1); + __pyx_v_self->children = __pyx_t_1; __pyx_t_1 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":63 + * cdef public children + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.children = {} + * + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -38020,6 +40080,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2s return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":61 + * + * cdef class TrieNode: + * cdef public children # <<<<<<<<<<<<<< + * + * def __cinit__(self): + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_1__get__(PyObject *__pyx_v_self) { @@ -38027,18 +40095,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_1__get__(PyObject * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children___get__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":61 - * - * cdef class TrieNode: - * cdef public children # <<<<<<<<<<<<<< - * - * def __cinit__(self): - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children___get__(struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -38048,7 +40110,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children___get__(struct __py __pyx_r = __pyx_v_self->children; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -38062,6 +40124,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_3__set__(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38076,6 +40140,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children_2__set__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->children); __pyx_v_self->children = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -38088,6 +40153,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_5__del__(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38102,11 +40169,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children_4__del__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->children); __pyx_v_self->children = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":71 + * cdef public suffix_link + * + * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<< + * self.phrase = phrase + * self.phrase_location = phrase_location + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -38120,16 +40196,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx __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}; + 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}; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":71 - * cdef public suffix_link - * - * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<< - * self.phrase = phrase - * self.phrase_location = phrase_location - */ values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); @@ -38147,17 +40215,17 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__phrase); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_phrase); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__phrase_location); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_phrase_location); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__suffix_link); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suffix_link); if (value) { values[2] = value; kw_args--; } } } @@ -38186,6 +40254,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)__pyx_v_self), __pyx_v_phrase, __pyx_v_phrase_location, __pyx_v_suffix_link); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38195,7 +40265,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":72 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":72 * * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): * self.phrase = phrase # <<<<<<<<<<<<<< @@ -38208,7 +40278,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->phrase); __pyx_v_self->phrase = __pyx_v_phrase; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":73 * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): * self.phrase = phrase * self.phrase_location = phrase_location # <<<<<<<<<<<<<< @@ -38221,7 +40291,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->phrase_location); __pyx_v_self->phrase_location = __pyx_v_phrase_location; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":74 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":74 * self.phrase = phrase * self.phrase_location = phrase_location * self.suffix_link = suffix_link # <<<<<<<<<<<<<< @@ -38234,11 +40304,28 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->suffix_link); __pyx_v_self->suffix_link = __pyx_v_suffix_link; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":71 + * cdef public suffix_link + * + * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<< + * self.phrase = phrase + * self.phrase_location = phrase_location + */ + + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":67 + * + * cdef class ExtendedTrieNode(TrieNode): + * cdef public phrase # <<<<<<<<<<<<<< + * cdef public phrase_location + * cdef public suffix_link + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject *__pyx_v_self) { @@ -38246,18 +40333,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase___get__(((struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":67 - * - * cdef class ExtendedTrieNode(TrieNode): - * cdef public phrase # <<<<<<<<<<<<<< - * cdef public phrase_location - * cdef public suffix_link - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase___get__(struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -38267,7 +40348,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase___get__(stru __pyx_r = __pyx_v_self->phrase; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -38281,6 +40362,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_3__set__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38295,6 +40378,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_2__set__(struct __ __Pyx_DECREF(__pyx_v_self->phrase); __pyx_v_self->phrase = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -38307,6 +40391,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_5__del__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38321,11 +40407,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_4__del__(struct __ __Pyx_DECREF(__pyx_v_self->phrase); __pyx_v_self->phrase = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":68 + * cdef class ExtendedTrieNode(TrieNode): + * cdef public phrase + * cdef public phrase_location # <<<<<<<<<<<<<< + * cdef public suffix_link + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(PyObject *__pyx_v_self) { @@ -38333,18 +40428,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_1_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location___get__(((struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":68 - * cdef class ExtendedTrieNode(TrieNode): - * cdef public phrase - * cdef public phrase_location # <<<<<<<<<<<<<< - * cdef public suffix_link - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location___get__(struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -38354,7 +40443,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location___ __pyx_r = __pyx_v_self->phrase_location; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -38368,6 +40457,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_3__set__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38382,6 +40473,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_2__set__ __Pyx_DECREF(__pyx_v_self->phrase_location); __pyx_v_self->phrase_location = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -38394,6 +40486,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_5__del__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38408,11 +40502,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_4__del__ __Pyx_DECREF(__pyx_v_self->phrase_location); __pyx_v_self->phrase_location = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":69 + * cdef public phrase + * cdef public phrase_location + * cdef public suffix_link # <<<<<<<<<<<<<< + * + * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(PyObject *__pyx_v_self) { @@ -38420,18 +40523,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_1__get __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link___get__(((struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":69 - * cdef public phrase - * cdef public phrase_location - * cdef public suffix_link # <<<<<<<<<<<<<< - * - * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link___get__(struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -38441,7 +40538,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link___get_ __pyx_r = __pyx_v_self->suffix_link; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -38455,6 +40552,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_3__set__(PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38469,6 +40568,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_2__set__(str __Pyx_DECREF(__pyx_v_self->suffix_link); __pyx_v_self->suffix_link = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -38481,6 +40581,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_5__del__(PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38495,11 +40597,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_4__del__(str __Pyx_DECREF(__pyx_v_self->suffix_link); __pyx_v_self->suffix_link = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":81 + * cdef public int count + * cdef public root + * def __cinit__(self, extended=False): # <<<<<<<<<<<<<< + * self.count = 0 + * self.extended = extended + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -38511,9 +40622,9 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__extended,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_extended,0}; PyObject* values[1] = {0}; - values[0] = __pyx_k_103; + values[0] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); @@ -38526,7 +40637,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__extended); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extended); if (value) { values[0] = value; kw_args--; } } } @@ -38551,18 +40662,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_v_self), __pyx_v_extended); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":81 - * cdef public int count - * cdef public root - * def __cinit__(self, extended=False): # <<<<<<<<<<<<<< - * self.count = 0 - * self.extended = extended - */ - static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_extended) { int __pyx_r; __Pyx_RefNannyDeclarations @@ -38574,7 +40679,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":82 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":82 * cdef public root * def __cinit__(self, extended=False): * self.count = 0 # <<<<<<<<<<<<<< @@ -38583,17 +40688,17 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2 */ __pyx_v_self->count = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":83 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":83 * def __cinit__(self, extended=False): * self.count = 0 * self.extended = extended # <<<<<<<<<<<<<< * if extended: * self.root = ExtendedTrieNode() */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_extended); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_extended); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->extended = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":84 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":84 * self.count = 0 * self.extended = extended * if extended: # <<<<<<<<<<<<<< @@ -38603,14 +40708,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":85 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":85 * self.extended = extended * if extended: * self.root = ExtendedTrieNode() # <<<<<<<<<<<<<< * else: * self.root = TrieNode() */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root); @@ -38621,14 +40726,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2 } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":87 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":87 * self.root = ExtendedTrieNode() * else: * self.root = TrieNode() # <<<<<<<<<<<<<< * * # linked list structure for storing matches in BaselineRuleFactory */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieNode)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root); @@ -38638,6 +40743,15 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2 } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":81 + * cdef public int count + * cdef public root + * def __cinit__(self, extended=False): # <<<<<<<<<<<<<< + * self.count = 0 + * self.extended = extended + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -38649,6 +40763,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2 return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":78 + * + * cdef class TrieTable: + * cdef public int extended # <<<<<<<<<<<<<< + * cdef public int count + * cdef public root + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_8extended_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_8extended_1__get__(PyObject *__pyx_v_self) { @@ -38656,18 +40778,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_8extended_1__get__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended___get__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":78 - * - * cdef class TrieTable: - * cdef public int extended # <<<<<<<<<<<<<< - * cdef public int count - * cdef public root - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended___get__(struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -38677,14 +40793,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->extended); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->extended); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 78; __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; + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.TrieTable.extended.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -38702,6 +40817,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_8extended_3__set__(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38714,9 +40831,10 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended_2__set__(struct __pyx_ob 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[8]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->extended = __pyx_t_1; + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -38727,6 +40845,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended_2__set__(struct __pyx_ob return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":79 + * cdef class TrieTable: + * cdef public int extended + * cdef public int count # <<<<<<<<<<<<<< + * cdef public root + * def __cinit__(self, extended=False): + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v_self) { @@ -38734,18 +40860,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_5count_1__get__(PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count___get__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":79 - * cdef class TrieTable: - * cdef public int extended - * cdef public int count # <<<<<<<<<<<<<< - * cdef public root - * def __cinit__(self, extended=False): - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count___get__(struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -38755,14 +40875,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count___get__(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 79; __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; + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.TrieTable.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -38780,6 +40899,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_5count_3__set__(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38792,9 +40913,10 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count_2__set__(struct __pyx_obj_4 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[8]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->count = __pyx_t_1; + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -38805,6 +40927,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count_2__set__(struct __pyx_obj_4 return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":80 + * cdef public int extended + * cdef public int count + * cdef public root # <<<<<<<<<<<<<< + * def __cinit__(self, extended=False): + * self.count = 0 + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_self) { @@ -38812,18 +40942,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_1__get__(PyObject *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root___get__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":80 - * cdef public int extended - * cdef public int count - * cdef public root # <<<<<<<<<<<<<< - * def __cinit__(self, extended=False): - * self.count = 0 - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root___get__(struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -38833,7 +40957,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root___get__(struct __pyx_o __pyx_r = __pyx_v_self->root; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -38847,6 +40971,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_3__set__(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38861,6 +40987,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root_2__set__(struct __pyx_obj_4c __Pyx_DECREF(__pyx_v_self->root); __pyx_v_self->root = __pyx_v_value; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -38873,6 +41000,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_5__del__(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38887,12 +41016,13 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_4c __Pyx_DECREF(__pyx_v_self->root); __pyx_v_self->root = Py_None; + /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":107 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":107 * * # returns true if sent_id is contained * cdef int contains(self, int sent_id): # <<<<<<<<<<<<<< @@ -38905,7 +41035,7 @@ static int __pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":108 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":108 * # returns true if sent_id is contained * cdef int contains(self, int sent_id): * return 1 # <<<<<<<<<<<<<< @@ -38915,12 +41045,28 @@ static int __pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct __pyx_r = 1; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":107 + * + * # returns true if sent_id is contained + * cdef int contains(self, int sent_id): # <<<<<<<<<<<<<< + * return 1 + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":110 + * return 1 + * + * def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<< + * arr=None, int num_subpatterns=1): + * self.sa_low = sa_low + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -38937,10 +41083,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v __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}; + 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}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":111 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":111 * * def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, * arr=None, int num_subpatterns=1): # <<<<<<<<<<<<<< @@ -38965,32 +41111,32 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sa_low); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sa_low); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sa_high); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sa_high); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr_low); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr_low); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr_high); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr_high); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__num_subpatterns); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_subpatterns); if (value) { values[5] = value; kw_args--; } } } @@ -39010,28 +41156,28 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v } } if (values[0]) { - __pyx_v_sa_low = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_sa_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sa_low = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_sa_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_sa_low = ((int)-1); } if (values[1]) { - __pyx_v_sa_high = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_sa_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sa_high = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_sa_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_sa_high = ((int)-1); } if (values[2]) { - __pyx_v_arr_low = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_arr_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_arr_low = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_arr_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_arr_low = ((int)-1); } if (values[3]) { - __pyx_v_arr_high = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_arr_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_arr_high = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_arr_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_arr_high = ((int)-1); } __pyx_v_arr = values[4]; if (values[5]) { - __pyx_v_num_subpatterns = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_num_subpatterns == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_num_subpatterns = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_num_subpatterns == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_num_subpatterns = ((int)1); } @@ -39045,11 +41191,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(((struct __pyx_obj_4cdec_2sa_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; -} -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":110 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":110 * return 1 * * def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<< @@ -39057,15 +41200,21 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v * self.sa_low = sa_low */ + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4cdec_2sa_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 + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":112 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":112 * def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, * arr=None, int num_subpatterns=1): * self.sa_low = sa_low # <<<<<<<<<<<<<< @@ -39074,7 +41223,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 */ __pyx_v_self->sa_low = __pyx_v_sa_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":113 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":113 * arr=None, int num_subpatterns=1): * self.sa_low = sa_low * self.sa_high = sa_high # <<<<<<<<<<<<<< @@ -39083,7 +41232,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 */ __pyx_v_self->sa_high = __pyx_v_sa_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":114 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":114 * self.sa_low = sa_low * self.sa_high = sa_high * self.arr_low = arr_low # <<<<<<<<<<<<<< @@ -39092,7 +41241,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 */ __pyx_v_self->arr_low = __pyx_v_arr_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":115 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":115 * self.sa_high = sa_high * self.arr_low = arr_low * self.arr_high = arr_high # <<<<<<<<<<<<<< @@ -39101,7 +41250,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 */ __pyx_v_self->arr_high = __pyx_v_arr_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":116 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":116 * self.arr_low = arr_low * self.arr_high = arr_high * self.arr = arr # <<<<<<<<<<<<<< @@ -39109,13 +41258,15 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 * */ if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_arr); - __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = __pyx_v_arr; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->arr); __Pyx_DECREF(((PyObject *)__pyx_v_self->arr)); - __pyx_v_self->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_arr); + __pyx_v_self->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":117 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":117 * self.arr_high = arr_high * self.arr = arr * self.num_subpatterns = num_subpatterns # <<<<<<<<<<<<<< @@ -39124,9 +41275,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 */ __pyx_v_self->num_subpatterns = __pyx_v_num_subpatterns; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":110 + * return 1 + * + * def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<< + * arr=None, int num_subpatterns=1): + * self.sa_low = sa_low + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.PhraseLocation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -39134,6 +41295,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4 return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":127 + * cdef IntList sa + * + * def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<< + * self.sample_size = sample_size + * self.sa = fsarray.sa + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -39146,7 +41315,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sample_size,&__pyx_n_s__fsarray,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; @@ -39160,10 +41329,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sample_size)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray)) != 0)) 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 = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -39177,7 +41346,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P values[0] = PyTuple_GET_ITEM(__pyx_args, 0); 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 = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sample_size = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_sample_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_fsarray = ((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)values[1]); } goto __pyx_L4_argument_unpacking_done; @@ -39190,6 +41359,8 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)__pyx_v_self), __pyx_v_sample_size, __pyx_v_fsarray); + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; @@ -39198,14 +41369,6 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":127 - * cdef IntList sa - * - * def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<< - * self.sample_size = sample_size - * self.sa = fsarray.sa - */ - static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_Sampler *__pyx_v_self, int __pyx_v_sample_size, struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_fsarray) { int __pyx_r; __Pyx_RefNannyDeclarations @@ -39218,7 +41381,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":128 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":128 * * def __cinit__(self, int sample_size, SuffixArray fsarray): * self.sample_size = sample_size # <<<<<<<<<<<<<< @@ -39227,7 +41390,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa */ __pyx_v_self->sample_size = __pyx_v_sample_size; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":129 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":129 * def __cinit__(self, int sample_size, SuffixArray fsarray): * self.sample_size = sample_size * self.sa = fsarray.sa # <<<<<<<<<<<<<< @@ -39242,7 +41405,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa __pyx_v_self->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":130 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":130 * self.sample_size = sample_size * self.sa = fsarray.sa * if sample_size > 0: # <<<<<<<<<<<<<< @@ -39252,56 +41415,65 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa __pyx_t_2 = ((__pyx_v_sample_size > 0) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":131 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":131 * self.sa = fsarray.sa * if sample_size > 0: * logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) # <<<<<<<<<<<<<< * else: * logger.info("Sampling strategy: no sampling") */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_sample_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_sample_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_104)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_104)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_104)); + __Pyx_INCREF(__pyx_kp_s_Sampling_strategy_uniform_max_sa); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_Sampling_strategy_uniform_max_sa); + __Pyx_GIVEREF(__pyx_kp_s_Sampling_strategy_uniform_max_sa); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":133 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":133 * logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) * else: * logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<< * * def sample(self, PhraseLocation phrase_location): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":127 + * cdef IntList sa + * + * def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<< + * self.sample_size = sample_size + * self.sa = fsarray.sa + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -39315,6 +41487,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":135 + * logger.info("Sampling strategy: no sampling") + * + * def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<< + * '''Returns a sample of the locations for + * the phrase. If there are less than self.sample_size + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase_location); /*proto*/ static char __pyx_doc_4cdec_2sa_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"; @@ -39327,6 +41507,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7Sampler_3sample(PyObject *__pyx_v_self __Pyx_RefNannySetupContext("sample (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)__pyx_v_self), ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_v_phrase_location)); + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -39335,14 +41517,6 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7Sampler_3sample(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":135 - * logger.info("Sampling strategy: no sampling") - * - * def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<< - * '''Returns a sample of the locations for - * the phrase. If there are less than self.sample_size - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec_2sa_3_sa_Sampler *__pyx_v_self, struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_v_phrase_location) { struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_v_sample = 0; double __pyx_v_i; @@ -39362,19 +41536,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sample", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":148 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":148 * cdef int num_locations, val, j * * sample = IntList() # <<<<<<<<<<<<<< * 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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_sample = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":149 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":149 * * sample = IntList() * if phrase_location.arr is None: # <<<<<<<<<<<<<< @@ -39385,7 +41559,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":150 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":150 * sample = IntList() * if phrase_location.arr is None: * num_locations = phrase_location.sa_high - phrase_location.sa_low # <<<<<<<<<<<<<< @@ -39394,7 +41568,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec */ __pyx_v_num_locations = (__pyx_v_phrase_location->sa_high - __pyx_v_phrase_location->sa_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":151 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":151 * if phrase_location.arr is None: * num_locations = phrase_location.sa_high - phrase_location.sa_low * if self.sample_size == -1 or num_locations <= self.sample_size: # <<<<<<<<<<<<<< @@ -39410,7 +41584,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":152 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":152 * num_locations = phrase_location.sa_high - phrase_location.sa_low * if self.sample_size == -1 or num_locations <= self.sample_size: * sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations) # <<<<<<<<<<<<<< @@ -39422,7 +41596,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":154 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":154 * sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations) * else: * stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<< @@ -39433,7 +41607,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif @@ -39441,7 +41615,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } __pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":155 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":155 * else: * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.sa_low # <<<<<<<<<<<<<< @@ -39451,7 +41625,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_t_5 = __pyx_v_phrase_location->sa_low; __pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":156 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":156 * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.sa_low * while i < phrase_location.sa_high and sample.len < self.sample_size: # <<<<<<<<<<<<<< @@ -39468,7 +41642,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":159 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":159 * '''Note: int(i) not guaranteed to have the desired * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<< @@ -39478,7 +41652,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_t_2 = ((fmod(__pyx_v_i, 1.0) > 0.5) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":160 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":160 * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: * val = int(ceil(i)) # <<<<<<<<<<<<<< @@ -39490,7 +41664,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":162 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":162 * val = int(ceil(i)) * else: * val = int(floor(i)) # <<<<<<<<<<<<<< @@ -39501,7 +41675,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":163 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":163 * else: * val = int(floor(i)) * sample._append(self.sa.arr[val]) # <<<<<<<<<<<<<< @@ -39510,7 +41684,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_append(__pyx_v_sample, (__pyx_v_self->sa->arr[__pyx_v_val])); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":164 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":164 * val = int(floor(i)) * sample._append(self.sa.arr[val]) * i = i + stepsize # <<<<<<<<<<<<<< @@ -39525,7 +41699,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":166 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":166 * i = i + stepsize * else: * num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns # <<<<<<<<<<<<<< @@ -39537,17 +41711,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif {__pyx_filename = __pyx_f[8]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_phrase_location->num_subpatterns == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_5))) { + else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_phrase_location->num_subpatterns == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_5))) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_OverflowError, "value too large to perform division"); + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif @@ -39555,7 +41729,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } __pyx_v_num_locations = __Pyx_div_int(__pyx_t_5, __pyx_v_phrase_location->num_subpatterns); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":167 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":167 * else: * num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns * if self.sample_size == -1 or num_locations <= self.sample_size: # <<<<<<<<<<<<<< @@ -39571,7 +41745,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":168 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":168 * num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns * if self.sample_size == -1 or num_locations <= self.sample_size: * sample = phrase_location.arr # <<<<<<<<<<<<<< @@ -39586,7 +41760,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":170 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":170 * sample = phrase_location.arr * else: * stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<< @@ -39597,7 +41771,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif @@ -39605,7 +41779,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } __pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":171 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":171 * else: * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.arr_low # <<<<<<<<<<<<<< @@ -39615,7 +41789,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_t_5 = __pyx_v_phrase_location->arr_low; __pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":172 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":172 * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.arr_low * while i < num_locations and sample.len < self.sample_size * phrase_location.num_subpatterns: # <<<<<<<<<<<<<< @@ -39632,7 +41806,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } if (!__pyx_t_4) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":175 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":175 * '''Note: int(i) not guaranteed to have the desired * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<< @@ -39642,7 +41816,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_t_4 = ((fmod(__pyx_v_i, 1.0) > 0.5) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":176 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":176 * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: * val = int(ceil(i)) # <<<<<<<<<<<<<< @@ -39654,7 +41828,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":178 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":178 * val = int(ceil(i)) * else: * val = int(floor(i)) # <<<<<<<<<<<<<< @@ -39665,7 +41839,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } __pyx_L11:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":179 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":179 * else: * val = int(floor(i)) * j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) # <<<<<<<<<<<<<< @@ -39674,7 +41848,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec */ __pyx_v_j = (__pyx_v_phrase_location->arr_low + (__pyx_v_val * __pyx_v_phrase_location->num_subpatterns)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":180 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":180 * val = int(floor(i)) * j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) * sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) # <<<<<<<<<<<<<< @@ -39683,7 +41857,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec */ ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":181 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":181 * j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) * sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) * i = i + stepsize # <<<<<<<<<<<<<< @@ -39697,7 +41871,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":182 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":182 * sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) * i = i + stepsize * return sample # <<<<<<<<<<<<<< @@ -39709,8 +41883,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec __pyx_r = ((PyObject *)__pyx_v_sample); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":135 + * logger.info("Sampling strategy: no sampling") + * + * def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<< + * '''Returns a sample of the locations for + * the phrase. If there are less than self.sample_size + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.Sampler.sample", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -39722,7 +41903,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":194 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":194 * * * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): # <<<<<<<<<<<<<< @@ -39734,7 +41915,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assign_matching", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":195 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":195 * * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): * m.arr = arr # <<<<<<<<<<<<<< @@ -39743,7 +41924,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa */ __pyx_v_m->arr = __pyx_v_arr; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":196 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":196 * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): * m.arr = arr * m.start = start # <<<<<<<<<<<<<< @@ -39752,7 +41933,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa */ __pyx_v_m->start = __pyx_v_start; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":197 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":197 * m.arr = arr * m.start = start * m.end = start + step # <<<<<<<<<<<<<< @@ -39761,7 +41942,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa */ __pyx_v_m->end = (__pyx_v_start + __pyx_v_step); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":198 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":198 * m.start = start * m.end = start + step * m.sent_id = sent_id_arr[arr[start]] # <<<<<<<<<<<<<< @@ -39770,7 +41951,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa */ __pyx_v_m->sent_id = (__pyx_v_sent_id_arr[(__pyx_v_arr[__pyx_v_start])]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":199 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":199 * m.end = start + step * m.sent_id = sent_id_arr[arr[start]] * m.size = step # <<<<<<<<<<<<<< @@ -39779,10 +41960,19 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa */ __pyx_v_m->size = __pyx_v_step; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":194 + * + * + * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): # <<<<<<<<<<<<<< + * m.arr = arr + * m.start = start + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":202 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":202 * * * cdef int* append_combined_matching(int* arr, Matching* loc1, Matching* loc2, # <<<<<<<<<<<<<< @@ -39799,7 +41989,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st int __pyx_t_2; __Pyx_RefNannySetupContext("append_combined_matching", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":206 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":206 * cdef int i, new_len * * new_len = result_len[0] + num_subpatterns # <<<<<<<<<<<<<< @@ -39808,7 +41998,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st */ __pyx_v_new_len = ((__pyx_v_result_len[0]) + __pyx_v_num_subpatterns); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":207 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":207 * * new_len = result_len[0] + num_subpatterns * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -39817,7 +42007,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":209 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":209 * arr = realloc(arr, new_len*sizeof(int)) * * for i from 0 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -39827,7 +42017,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st __pyx_t_1 = __pyx_v_loc1->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":210 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":210 * * for i from 0 <= i < loc1.size: * arr[result_len[0]+i] = loc1.arr[loc1.start+i] # <<<<<<<<<<<<<< @@ -39837,7 +42027,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st (__pyx_v_arr[((__pyx_v_result_len[0]) + __pyx_v_i)]) = (__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":211 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":211 * for i from 0 <= i < loc1.size: * arr[result_len[0]+i] = loc1.arr[loc1.start+i] * if num_subpatterns > loc1.size: # <<<<<<<<<<<<<< @@ -39847,7 +42037,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st __pyx_t_2 = ((__pyx_v_num_subpatterns > __pyx_v_loc1->size) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":212 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":212 * arr[result_len[0]+i] = loc1.arr[loc1.start+i] * if num_subpatterns > loc1.size: * arr[new_len-1] = loc2.arr[loc2.end-1] # <<<<<<<<<<<<<< @@ -39859,7 +42049,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":213 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":213 * if num_subpatterns > loc1.size: * arr[new_len-1] = loc2.arr[loc2.end-1] * result_len[0] = new_len # <<<<<<<<<<<<<< @@ -39868,7 +42058,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st */ (__pyx_v_result_len[0]) = __pyx_v_new_len; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":214 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":214 * arr[new_len-1] = loc2.arr[loc2.end-1] * result_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -39878,13 +42068,21 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st __pyx_r = __pyx_v_arr; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":202 + * + * + * cdef int* append_combined_matching(int* arr, Matching* loc1, Matching* loc2, # <<<<<<<<<<<<<< + * int offset_by_one, int num_subpatterns, int* result_len): + * cdef int i, new_len + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":217 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":217 * * * cdef int* extend_arr(int* arr, int* arr_len, int* appendix, int appendix_len): # <<<<<<<<<<<<<< @@ -39898,7 +42096,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extend_arr", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":220 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":220 * cdef int new_len * * new_len = arr_len[0] + appendix_len # <<<<<<<<<<<<<< @@ -39907,7 +42105,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr */ __pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_appendix_len); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":221 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":221 * * new_len = arr_len[0] + appendix_len * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -39916,7 +42114,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":222 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":222 * new_len = arr_len[0] + appendix_len * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -39925,7 +42123,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr */ memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_appendix, (__pyx_v_appendix_len * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":223 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":223 * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) * arr_len[0] = new_len # <<<<<<<<<<<<<< @@ -39934,7 +42132,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr */ (__pyx_v_arr_len[0]) = __pyx_v_new_len; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":224 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":224 * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) * arr_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -39944,13 +42142,21 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr __pyx_r = __pyx_v_arr; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":217 + * + * + * cdef int* extend_arr(int* arr, int* arr_len, int* appendix, int appendix_len): # <<<<<<<<<<<<<< + * cdef int new_len + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":226 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":226 * return arr * * cdef int median(int low, int high, int step): # <<<<<<<<<<<<<< @@ -39967,7 +42173,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int int __pyx_clineno = 0; __Pyx_RefNannySetupContext("median", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":227 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":227 * * cdef int median(int low, int high, int step): * return low + (((high - low)/step)/2)*step # <<<<<<<<<<<<<< @@ -39979,17 +42185,17 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif {__pyx_filename = __pyx_f[8]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_1))) { + else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_step == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_1))) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_OverflowError, "value too large to perform division"); + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif @@ -39998,17 +42204,24 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_r = (__pyx_v_low + (__Pyx_div_long(__Pyx_div_int(__pyx_t_1, __pyx_v_step), 2) * __pyx_v_step)); goto __pyx_L0; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":226 + * return arr + * + * cdef int median(int low, int high, int step): # <<<<<<<<<<<<<< + * return low + (((high - low)/step)/2)*step + * + */ + + /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("cdec.sa._sa.median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":230 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":230 * * * cdef void find_comparable_matchings(int low, int high, int* arr, int step, int loc, int* loc_minus, int* loc_plus): # <<<<<<<<<<<<<< @@ -40023,7 +42236,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in int __pyx_t_3; __Pyx_RefNannySetupContext("find_comparable_matchings", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":234 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":234 * # in which all matchings have the same first index as the one * # starting at loc * loc_plus[0] = loc + step # <<<<<<<<<<<<<< @@ -40032,7 +42245,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in */ (__pyx_v_loc_plus[0]) = (__pyx_v_loc + __pyx_v_step); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":235 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":235 * # starting at loc * loc_plus[0] = loc + step * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: # <<<<<<<<<<<<<< @@ -40049,7 +42262,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in } if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":236 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":236 * loc_plus[0] = loc + step * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: * loc_plus[0] = loc_plus[0] + step # <<<<<<<<<<<<<< @@ -40059,7 +42272,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in (__pyx_v_loc_plus[0]) = ((__pyx_v_loc_plus[0]) + __pyx_v_step); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":237 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":237 * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: * loc_plus[0] = loc_plus[0] + step * loc_minus[0] = loc # <<<<<<<<<<<<<< @@ -40068,7 +42281,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in */ (__pyx_v_loc_minus[0]) = __pyx_v_loc; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":238 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":238 * loc_plus[0] = loc_plus[0] + step * loc_minus[0] = loc * while loc_minus[0]-step >= low and arr[loc_minus[0]-step] == arr[loc]: # <<<<<<<<<<<<<< @@ -40085,7 +42298,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in } if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":239 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":239 * loc_minus[0] = loc * while loc_minus[0]-step >= low and arr[loc_minus[0]-step] == arr[loc]: * loc_minus[0] = loc_minus[0] - step # <<<<<<<<<<<<<< @@ -40095,13 +42308,31 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in (__pyx_v_loc_minus[0]) = ((__pyx_v_loc_minus[0]) - __pyx_v_step); } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":230 + * + * + * cdef void find_comparable_matchings(int low, int high, int* arr, int step, int loc, int* loc_minus, int* loc_plus): # <<<<<<<<<<<<<< + * # Returns (minus, plus) indices for the portion of the array + * # in which all matchings have the same first index as the one + */ + + /* function exit code */ __Pyx_RefNannyFinishContext(); } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":296 + * cdef bilex + * + * def __cinit__(self, # <<<<<<<<<<<<<< + * # compiled alignment object (REQUIRED) + * Alignment alignment, + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_alignment = 0; + PyObject *__pyx_v_bilex = 0; float __pyx_v_by_slack_factor; char *__pyx_v_category; PyObject *__pyx_v_max_chunks = 0; @@ -40129,48 +42360,58 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject __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_72,&__pyx_n_s__precompute_rank,&__pyx_n_s_107,&__pyx_n_s_108,&__pyx_n_s_73,&__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}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alignment,&__pyx_n_s_bilex,&__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_precompute_secondary_rank,&__pyx_n_s_precompute_rank,&__pyx_n_s_require_aligned_terminal,&__pyx_n_s_require_aligned_chunks,&__pyx_n_s_train_max_initial_size,&__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[22] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":303 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":300 + * Alignment alignment, + * # bilexical dictionary if online + * bilex=None, # <<<<<<<<<<<<<< + * # parameter for double-binary search; doesn't seem to matter much + * float by_slack_factor=1.0, + */ + values[1] = ((PyObject *)Py_None); + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":306 * char* category="[X]", * # maximum number of contiguous chunks of terminal symbols in RHS of a rule. If None, defaults to max_nonterminals+1 * max_chunks=None, # <<<<<<<<<<<<<< * # maximum span of a grammar rule in TEST DATA * unsigned max_initial_size=10, */ - values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_None); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":311 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":314 * unsigned max_nonterminals=2, * # maximum number of contiguous chunks of terminal symbols in target-side RHS of a rule. If None, defaults to max_nonterminals+1 * max_target_chunks=None, # <<<<<<<<<<<<<< * # maximum number of target side symbols (both T and NT) allowed in a rule. If None, defaults to max_initial_size * max_target_length=None, */ - values[7] = ((PyObject *)Py_None); + values[8] = ((PyObject *)Py_None); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":313 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":316 * max_target_chunks=None, * # maximum number of target side symbols (both T and NT) allowed in a rule. If None, defaults to max_initial_size * max_target_length=None, # <<<<<<<<<<<<<< * # minimum span of a nonterminal in the RHS of a rule in TEST DATA * unsigned min_gap_size=2, */ - values[8] = ((PyObject *)Py_None); + values[9] = ((PyObject *)Py_None); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":317 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":320 * unsigned min_gap_size=2, * # filename of file containing precomputed collocations * precompute_file=None, # <<<<<<<<<<<<<< * # maximum frequency rank of patterns used to compute triples (don't set higher than 20). * unsigned precompute_secondary_rank=20, */ - values[10] = ((PyObject *)Py_None); + values[11] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { + case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21); case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20); case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19); case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18); @@ -40198,114 +42439,120 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment)) != 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) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__by_slack_factor); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bilex); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__category); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_by_slack_factor); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_chunks); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_category); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_initial_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_chunks); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_length); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_initial_size); if (value) { values[5] = value; kw_args--; } } case 6: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_nonterminals); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_length); if (value) { values[6] = value; kw_args--; } } case 7: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_target_chunks); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_nonterminals); if (value) { values[7] = value; kw_args--; } } case 8: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_target_length); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_target_chunks); if (value) { values[8] = value; kw_args--; } } case 9: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_gap_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_target_length); if (value) { values[9] = value; kw_args--; } } case 10: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__precompute_file); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_gap_size); if (value) { values[10] = value; kw_args--; } } case 11: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_72); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precompute_file); if (value) { values[11] = value; kw_args--; } } case 12: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__precompute_rank); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precompute_secondary_rank); if (value) { values[12] = value; kw_args--; } } case 13: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_107); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precompute_rank); if (value) { values[13] = value; kw_args--; } } case 14: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_108); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_require_aligned_terminal); if (value) { values[14] = value; kw_args--; } } case 15: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_73); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_require_aligned_chunks); if (value) { values[15] = value; kw_args--; } } case 16: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__train_min_gap_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_train_max_initial_size); if (value) { values[16] = value; kw_args--; } } case 17: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tight_phrases); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_train_min_gap_size); if (value) { values[17] = value; kw_args--; } } case 18: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_baeza_yates); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tight_phrases); if (value) { values[18] = value; kw_args--; } } case 19: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_collocations); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_baeza_yates); if (value) { values[19] = value; kw_args--; } } case 20: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_index); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_collocations); if (value) { values[20] = value; kw_args--; } } + case 21: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_index); + if (value) { values[21] = value; kw_args--; } + } } 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 = 295; __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[8]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { + case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21); case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20); case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19); case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18); @@ -40332,63 +42579,56 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject } } __pyx_v_alignment = ((struct __pyx_obj_4cdec_2sa_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 = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_bilex = values[1]; + if (values[2]) { + __pyx_v_by_slack_factor = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_by_slack_factor == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":299 - * 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]) { - __pyx_v_category = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[3]) { + __pyx_v_category = __Pyx_PyObject_AsString(values[3]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - __pyx_v_category = ((char *)__pyx_k_109); + __pyx_v_category = ((char *)__pyx_k_X_2); } - __pyx_v_max_chunks = values[3]; - if (values[4]) { - __pyx_v_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[4]); if (unlikely((__pyx_v_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_chunks = values[4]; + if (values[5]) { + __pyx_v_max_initial_size = __Pyx_PyInt_As_unsigned_int(values[5]); if (unlikely((__pyx_v_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_max_initial_size = ((unsigned int)10); } - if (values[5]) { - __pyx_v_max_length = __Pyx_PyInt_AsUnsignedInt(values[5]); if (unlikely((__pyx_v_max_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[6]) { + __pyx_v_max_length = __Pyx_PyInt_As_unsigned_int(values[6]); if (unlikely((__pyx_v_max_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_max_length = ((unsigned int)5); } - if (values[6]) { - __pyx_v_max_nonterminals = __Pyx_PyInt_AsUnsignedInt(values[6]); if (unlikely((__pyx_v_max_nonterminals == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[7]) { + __pyx_v_max_nonterminals = __Pyx_PyInt_As_unsigned_int(values[7]); if (unlikely((__pyx_v_max_nonterminals == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_max_nonterminals = ((unsigned int)2); } - __pyx_v_max_target_chunks = values[7]; - __pyx_v_max_target_length = values[8]; - if (values[9]) { - __pyx_v_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[9]); if (unlikely((__pyx_v_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_target_chunks = values[8]; + __pyx_v_max_target_length = values[9]; + if (values[10]) { + __pyx_v_min_gap_size = __Pyx_PyInt_As_unsigned_int(values[10]); if (unlikely((__pyx_v_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_min_gap_size = ((unsigned int)2); } - __pyx_v_precompute_file = values[10]; - if (values[11]) { - __pyx_v_precompute_secondary_rank = __Pyx_PyInt_AsUnsignedInt(values[11]); if (unlikely((__pyx_v_precompute_secondary_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_precompute_file = values[11]; + if (values[12]) { + __pyx_v_precompute_secondary_rank = __Pyx_PyInt_As_unsigned_int(values[12]); if (unlikely((__pyx_v_precompute_secondary_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_precompute_secondary_rank = ((unsigned int)20); } - if (values[12]) { - __pyx_v_precompute_rank = __Pyx_PyInt_AsUnsignedInt(values[12]); if (unlikely((__pyx_v_precompute_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[13]) { + __pyx_v_precompute_rank = __Pyx_PyInt_As_unsigned_int(values[13]); if (unlikely((__pyx_v_precompute_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_precompute_rank = ((unsigned int)100); } - if (values[13]) { - __pyx_v_require_aligned_terminal = __Pyx_PyObject_IsTrue(values[13]); if (unlikely((__pyx_v_require_aligned_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[14]) { + __pyx_v_require_aligned_terminal = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_require_aligned_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":323 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":326 * unsigned precompute_rank=100, * # require extracted rules to have at least one aligned word * bint require_aligned_terminal=True, # <<<<<<<<<<<<<< @@ -40397,11 +42637,11 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject */ __pyx_v_require_aligned_terminal = ((int)1); } - if (values[14]) { - __pyx_v_require_aligned_chunks = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_require_aligned_chunks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[15]) { + __pyx_v_require_aligned_chunks = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_require_aligned_chunks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":325 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":328 * bint require_aligned_terminal=True, * # require each contiguous chunk of extracted rules to have at least one aligned word * bint require_aligned_chunks=False, # <<<<<<<<<<<<<< @@ -40410,21 +42650,21 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject */ __pyx_v_require_aligned_chunks = ((int)0); } - if (values[15]) { - __pyx_v_train_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[15]); if (unlikely((__pyx_v_train_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[16]) { + __pyx_v_train_max_initial_size = __Pyx_PyInt_As_unsigned_int(values[16]); if (unlikely((__pyx_v_train_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_train_max_initial_size = ((unsigned int)10); } - if (values[16]) { - __pyx_v_train_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[16]); if (unlikely((__pyx_v_train_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[17]) { + __pyx_v_train_min_gap_size = __Pyx_PyInt_As_unsigned_int(values[17]); if (unlikely((__pyx_v_train_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_train_min_gap_size = ((unsigned int)2); } - if (values[17]) { - __pyx_v_tight_phrases = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_tight_phrases == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[18]) { + __pyx_v_tight_phrases = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_tight_phrases == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":331 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":334 * unsigned train_min_gap_size=2, * # False if phrases should be loose (better but slower), True otherwise * bint tight_phrases=True, # <<<<<<<<<<<<<< @@ -40433,11 +42673,11 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject */ __pyx_v_tight_phrases = ((int)1); } - if (values[18]) { - __pyx_v_use_baeza_yates = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_use_baeza_yates == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[19]) { + __pyx_v_use_baeza_yates = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_use_baeza_yates == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":333 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":336 * bint tight_phrases=True, * # True to require use of double-binary alg, false otherwise * bint use_baeza_yates=True, # <<<<<<<<<<<<<< @@ -40446,11 +42686,11 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject */ __pyx_v_use_baeza_yates = ((int)1); } - if (values[19]) { - __pyx_v_use_collocations = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_use_collocations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[20]) { + __pyx_v_use_collocations = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_use_collocations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":335 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":338 * bint use_baeza_yates=True, * # True to enable used of precomputed collocations * bint use_collocations=True, # <<<<<<<<<<<<<< @@ -40459,11 +42699,11 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject */ __pyx_v_use_collocations = ((int)1); } - if (values[20]) { - __pyx_v_use_index = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_use_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[21]) { + __pyx_v_use_index = __Pyx_PyObject_IsTrue(values[21]); if (unlikely((__pyx_v_use_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":337 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":340 * bint use_collocations=True, * # True to enable use of precomputed inverted indices * bint use_index=True): # <<<<<<<<<<<<<< @@ -40475,14 +42715,24 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 22, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._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_4cdec_2sa_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(((struct __pyx_obj_4cdec_2sa_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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_4cdec_2sa_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_alignment, __pyx_v_bilex, __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); + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":296 + * cdef bilex + * + * def __cinit__(self, # <<<<<<<<<<<<<< + * # compiled alignment object (REQUIRED) + * Alignment alignment, + */ + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; @@ -40491,15 +42741,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":295 - * cdef online_stats - * - * def __cinit__(self, # <<<<<<<<<<<<<< - * # compiled alignment object (REQUIRED) - * Alignment alignment, - */ - -static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_4cdec_2sa_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) { +static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_4cdec_2sa_3_sa_Alignment *__pyx_v_alignment, PyObject *__pyx_v_bilex, 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; @@ -40513,52 +42755,44 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":343 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":346 * respectively. This is because Chiang's model does not require * them to be the same, therefore we don't either.''' * self.rules = TrieTable(True) # cache # <<<<<<<<<<<<<< * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: */ - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 343; __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 = 343; __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); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieTable)), __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __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_4cdec_2sa_3_sa_TrieTable *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":344 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":347 * them to be the same, therefore we don't either.''' * self.rules = TrieTable(True) # cache * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<< * if alignment is None: * raise Exception("Must specify an alignment object") */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __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 = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_phrase_location, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __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_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->rules->root); __Pyx_DECREF(__pyx_v_self->rules->root); __pyx_v_self->rules->root = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":345 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":348 * self.rules = TrieTable(True) # cache * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: # <<<<<<<<<<<<<< @@ -40569,23 +42803,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":346 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":349 * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: * raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<< * self.alignment = alignment * */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":347 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":350 * if alignment is None: * raise Exception("Must specify an alignment object") * self.alignment = alignment # <<<<<<<<<<<<<< @@ -40598,7 +42830,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __Pyx_DECREF(((PyObject *)__pyx_v_self->alignment)); __pyx_v_self->alignment = __pyx_v_alignment; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":351 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":354 * # grammar parameters and settings * # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero * self.max_length = max_length # <<<<<<<<<<<<<< @@ -40607,7 +42839,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->max_length = __pyx_v_max_length; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":352 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":355 * # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero * self.max_length = max_length * self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<< @@ -40616,7 +42848,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->max_nonterminals = __pyx_v_max_nonterminals; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":353 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":356 * self.max_length = max_length * self.max_nonterminals = max_nonterminals * self.max_initial_size = max_initial_size # <<<<<<<<<<<<<< @@ -40625,7 +42857,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->max_initial_size = __pyx_v_max_initial_size; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":354 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":357 * self.max_nonterminals = max_nonterminals * self.max_initial_size = max_initial_size * self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<< @@ -40634,7 +42866,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->train_max_initial_size = __pyx_v_train_max_initial_size; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":355 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":358 * self.max_initial_size = max_initial_size * self.train_max_initial_size = train_max_initial_size * self.min_gap_size = min_gap_size # <<<<<<<<<<<<<< @@ -40643,7 +42875,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->min_gap_size = __pyx_v_min_gap_size; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":356 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":359 * self.train_max_initial_size = train_max_initial_size * self.min_gap_size = min_gap_size * self.train_min_gap_size = train_min_gap_size # <<<<<<<<<<<<<< @@ -40652,7 +42884,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->train_min_gap_size = __pyx_v_train_min_gap_size; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":357 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":360 * self.min_gap_size = min_gap_size * self.train_min_gap_size = train_min_gap_size * self.category = sym_fromstring(category, False) # <<<<<<<<<<<<<< @@ -40661,7 +42893,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->category = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_v_category, 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":359 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":362 * self.category = sym_fromstring(category, False) * * if max_chunks is None: # <<<<<<<<<<<<<< @@ -40672,7 +42904,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":360 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":363 * * if max_chunks is None: * self.max_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<< @@ -40684,19 +42916,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":362 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":365 * self.max_chunks = self.max_nonterminals + 1 * else: * self.max_chunks = max_chunks # <<<<<<<<<<<<<< * * if max_target_chunks is None: */ - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_max_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_chunks = __pyx_t_5; } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":364 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":367 * self.max_chunks = max_chunks * * if max_target_chunks is None: # <<<<<<<<<<<<<< @@ -40707,7 +42939,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":365 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":368 * * if max_target_chunks is None: * self.max_target_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<< @@ -40719,19 +42951,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":367 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":370 * self.max_target_chunks = self.max_nonterminals + 1 * else: * self.max_target_chunks = max_target_chunks # <<<<<<<<<<<<<< * * if max_target_length is None: */ - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_target_chunks = __pyx_t_5; } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":369 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":372 * self.max_target_chunks = max_target_chunks * * if max_target_length is None: # <<<<<<<<<<<<<< @@ -40742,7 +42974,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":370 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":373 * * if max_target_length is None: * self.max_target_length = max_initial_size # <<<<<<<<<<<<<< @@ -40754,49 +42986,49 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":372 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":375 * self.max_target_length = max_initial_size * else: * self.max_target_length = max_target_length # <<<<<<<<<<<<<< * * # algorithmic parameters and settings */ - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_max_target_length); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_target_length = __pyx_t_5; } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":375 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":378 * * # algorithmic parameters and settings * self.precomputed_collocations = {} # <<<<<<<<<<<<<< * self.precomputed_index = {} * self.use_index = use_index */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->precomputed_collocations); __Pyx_DECREF(__pyx_v_self->precomputed_collocations); - __pyx_v_self->precomputed_collocations = ((PyObject *)__pyx_t_2); + __pyx_v_self->precomputed_collocations = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":376 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":379 * # algorithmic parameters and settings * self.precomputed_collocations = {} * self.precomputed_index = {} # <<<<<<<<<<<<<< * self.use_index = use_index * self.use_collocations = use_collocations */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->precomputed_index); __Pyx_DECREF(__pyx_v_self->precomputed_index); - __pyx_v_self->precomputed_index = ((PyObject *)__pyx_t_2); + __pyx_v_self->precomputed_index = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":377 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":380 * self.precomputed_collocations = {} * self.precomputed_index = {} * self.use_index = use_index # <<<<<<<<<<<<<< @@ -40805,7 +43037,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->use_index = __pyx_v_use_index; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":378 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":381 * self.precomputed_index = {} * self.use_index = use_index * self.use_collocations = use_collocations # <<<<<<<<<<<<<< @@ -40814,22 +43046,22 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->use_collocations = __pyx_v_use_collocations; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":379 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":382 * self.use_index = use_index * self.use_collocations = use_collocations * self.max_rank = {} # <<<<<<<<<<<<<< * self.precompute_file = precompute_file * self.precompute_rank = precompute_rank */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->max_rank); __Pyx_DECREF(__pyx_v_self->max_rank); - __pyx_v_self->max_rank = ((PyObject *)__pyx_t_2); + __pyx_v_self->max_rank = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":380 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":383 * self.use_collocations = use_collocations * self.max_rank = {} * self.precompute_file = precompute_file # <<<<<<<<<<<<<< @@ -40842,7 +43074,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __Pyx_DECREF(__pyx_v_self->precompute_file); __pyx_v_self->precompute_file = __pyx_v_precompute_file; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":381 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":384 * self.max_rank = {} * self.precompute_file = precompute_file * self.precompute_rank = precompute_rank # <<<<<<<<<<<<<< @@ -40851,7 +43083,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->precompute_rank = __pyx_v_precompute_rank; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":382 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":385 * self.precompute_file = precompute_file * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<< @@ -40860,7 +43092,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->precompute_secondary_rank = __pyx_v_precompute_secondary_rank; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":383 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":386 * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank * self.use_baeza_yates = use_baeza_yates # <<<<<<<<<<<<<< @@ -40869,7 +43101,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->use_baeza_yates = __pyx_v_use_baeza_yates; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":384 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":387 * self.precompute_secondary_rank = precompute_secondary_rank * self.use_baeza_yates = use_baeza_yates * self.by_slack_factor = by_slack_factor # <<<<<<<<<<<<<< @@ -40878,7 +43110,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->by_slack_factor = __pyx_v_by_slack_factor; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":385 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":388 * self.use_baeza_yates = use_baeza_yates * self.by_slack_factor = by_slack_factor * self.tight_phrases = tight_phrases # <<<<<<<<<<<<<< @@ -40887,7 +43119,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->tight_phrases = __pyx_v_tight_phrases; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":387 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":390 * self.tight_phrases = tight_phrases * * if require_aligned_chunks: # <<<<<<<<<<<<<< @@ -40897,7 +43129,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_3 = (__pyx_v_require_aligned_chunks != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":389 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":392 * if require_aligned_chunks: * # one condition is a stronger version of the other. * self.require_aligned_chunks = self.require_aligned_terminal = True # <<<<<<<<<<<<<< @@ -40909,7 +43141,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ goto __pyx_L7; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":390 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":393 * # one condition is a stronger version of the other. * self.require_aligned_chunks = self.require_aligned_terminal = True * elif require_aligned_terminal: # <<<<<<<<<<<<<< @@ -40919,7 +43151,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ __pyx_t_3 = (__pyx_v_require_aligned_terminal != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":391 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":394 * self.require_aligned_chunks = self.require_aligned_terminal = True * elif require_aligned_terminal: * self.require_aligned_chunks = False # <<<<<<<<<<<<<< @@ -40928,7 +43160,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->require_aligned_chunks = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":392 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":395 * elif require_aligned_terminal: * self.require_aligned_chunks = False * self.require_aligned_terminal = True # <<<<<<<<<<<<<< @@ -40940,7 +43172,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":394 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":397 * self.require_aligned_terminal = True * else: * self.require_aligned_chunks = self.require_aligned_terminal = False # <<<<<<<<<<<<<< @@ -40952,58 +43184,71 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":397 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":400 * * # diagnostics * self.prev_norm_prefix = () # <<<<<<<<<<<<<< * * self.findexes = IntList(initial_len=10) */ - __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); - __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); __Pyx_GOTREF(__pyx_v_self->prev_norm_prefix); __Pyx_DECREF(__pyx_v_self->prev_norm_prefix); - __pyx_v_self->prev_norm_prefix = ((PyObject *)__pyx_empty_tuple); + __pyx_v_self->prev_norm_prefix = __pyx_empty_tuple; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":399 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":402 * self.prev_norm_prefix = () * * self.findexes = IntList(initial_len=10) # <<<<<<<<<<<<<< * self.findexes1 = IntList(initial_len=10) * */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_initial_len, __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->findexes); __Pyx_DECREF(((PyObject *)__pyx_v_self->findexes)); __pyx_v_self->findexes = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":400 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":403 * * self.findexes = IntList(initial_len=10) * self.findexes1 = IntList(initial_len=10) # <<<<<<<<<<<<<< * * # Online stats */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_initial_len, __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->findexes1); __Pyx_DECREF(((PyObject *)__pyx_v_self->findexes1)); __pyx_v_self->findexes1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":405 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":408 + * + * # None if not online + * self.bilex = bilex # <<<<<<<<<<<<<< + * + * # True after data is added + */ + __Pyx_INCREF(__pyx_v_bilex); + __Pyx_GIVEREF(__pyx_v_bilex); + __Pyx_GOTREF(__pyx_v_self->bilex); + __Pyx_DECREF(__pyx_v_self->bilex); + __pyx_v_self->bilex = __pyx_v_bilex; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":411 * * # True after data is added * self.online = False # <<<<<<<<<<<<<< @@ -41012,30 +43257,39 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ */ __pyx_v_self->online = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":406 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":412 * # True after data is added * self.online = False * self.online_stats = defaultdict(OnlineStats) # <<<<<<<<<<<<<< * * def configure(self, SuffixArray fsarray, DataArray edarray, */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __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 = 406; __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 = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_OnlineStats))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_OnlineStats))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_OnlineStats))); - __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->online_stats); __Pyx_DECREF(__pyx_v_self->online_stats); __pyx_v_self->online_stats = __pyx_t_6; __pyx_t_6 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":296 + * cdef bilex + * + * def __cinit__(self, # <<<<<<<<<<<<<< + * # compiled alignment object (REQUIRED) + * Alignment alignment, + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -41049,6 +43303,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":414 + * self.online_stats = defaultdict(OnlineStats) + * + * def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<< + * Sampler sampler, Scorer scorer): + * '''This gives the RuleFactory access to the Context object. + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4cdec_2sa_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."; @@ -41064,7 +43326,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("configure (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__edarray,&__pyx_n_s__sampler,&__pyx_n_s__scorer,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fsarray,&__pyx_n_s_edarray,&__pyx_n_s_sampler,&__pyx_n_s_scorer,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -41080,26 +43342,26 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(Py kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__edarray)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_edarray)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sampler)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sampler)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scorer)) != 0)) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scorer)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "configure") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "configure") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -41116,17 +43378,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._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_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_4cdec_2sa_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_4cdec_2sa_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_4cdec_2sa_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_4cdec_2sa_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_4cdec_2sa_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_4cdec_2sa_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fsarray, __pyx_v_edarray, __pyx_v_sampler, __pyx_v_scorer); + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -41135,14 +43399,6 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(Py return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":408 - * self.online_stats = defaultdict(OnlineStats) - * - * def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<< - * Sampler sampler, Scorer scorer): - * '''This gives the RuleFactory access to the Context object. - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_fsarray, struct __pyx_obj_4cdec_2sa_3_sa_DataArray *__pyx_v_edarray, struct __pyx_obj_4cdec_2sa_3_sa_Sampler *__pyx_v_sampler, struct __pyx_obj_4cdec_2sa_3_sa_Scorer *__pyx_v_scorer) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -41153,7 +43409,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("configure", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":413 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":419 * Here we also use it to precompute the most expensive intersections * in the corpus quickly.''' * self.fsa = fsarray # <<<<<<<<<<<<<< @@ -41166,7 +43422,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st __Pyx_DECREF(((PyObject *)__pyx_v_self->fsa)); __pyx_v_self->fsa = __pyx_v_fsarray; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":414 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":420 * in the corpus quickly.''' * self.fsa = fsarray * self.fda = fsarray.darray # <<<<<<<<<<<<<< @@ -41181,7 +43437,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st __pyx_v_self->fda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":415 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":421 * self.fsa = fsarray * self.fda = fsarray.darray * self.eda = edarray # <<<<<<<<<<<<<< @@ -41194,7 +43450,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st __Pyx_DECREF(((PyObject *)__pyx_v_self->eda)); __pyx_v_self->eda = __pyx_v_edarray; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":416 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":422 * self.fda = fsarray.darray * self.eda = edarray * self.fid2symid = self.set_idmap(self.fda) # <<<<<<<<<<<<<< @@ -41203,17 +43459,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st */ __pyx_t_1 = ((PyObject *)__pyx_v_self->fda); __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __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_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __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_4cdec_2sa_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":417 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":423 * self.eda = edarray * self.fid2symid = self.set_idmap(self.fda) * self.eid2symid = self.set_idmap(self.eda) # <<<<<<<<<<<<<< @@ -41222,31 +43478,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st */ __pyx_t_2 = ((PyObject *)__pyx_v_self->eda); __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __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_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __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_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":418 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":424 * self.fid2symid = self.set_idmap(self.fda) * self.eid2symid = self.set_idmap(self.eda) * self.precompute() # <<<<<<<<<<<<<< * self.sampler = sampler * self.scorer = scorer */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 424; __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 = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 424; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":419 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":425 * self.eid2symid = self.set_idmap(self.eda) * self.precompute() * self.sampler = sampler # <<<<<<<<<<<<<< @@ -41259,7 +43515,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st __Pyx_DECREF(((PyObject *)__pyx_v_self->sampler)); __pyx_v_self->sampler = __pyx_v_sampler; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":420 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":426 * self.precompute() * self.sampler = sampler * self.scorer = scorer # <<<<<<<<<<<<<< @@ -41272,6 +43528,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st __Pyx_DECREF(((PyObject *)__pyx_v_self->scorer)); __pyx_v_self->scorer = __pyx_v_scorer; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":414 + * self.online_stats = defaultdict(OnlineStats) + * + * def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<< + * Sampler sampler, Scorer scorer): + * '''This gives the RuleFactory access to the Context object. + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -41285,7 +43550,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":422 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":428 * self.scorer = scorer * * cdef set_idmap(self, DataArray darray): # <<<<<<<<<<<<<< @@ -41310,7 +43575,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_idmap", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":426 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":432 * cdef IntList idmap * * N = len(darray.id2word) # <<<<<<<<<<<<<< @@ -41319,30 +43584,30 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH */ __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[8]; __pyx_lineno = 426; __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[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_N = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":427 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":433 * * N = len(darray.id2word) * idmap = IntList(initial_len=N) # <<<<<<<<<<<<<< * for word_id from 0 <= word_id < N: * new_word_id = sym_fromstring(darray.id2word[word_id], True) */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 427; __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[8]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 433; __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[8]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_initial_len, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 433; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_idmap = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":428 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":434 * N = len(darray.id2word) * idmap = IntList(initial_len=N) * for word_id from 0 <= word_id < N: # <<<<<<<<<<<<<< @@ -41352,20 +43617,20 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH __pyx_t_4 = __pyx_v_N; for (__pyx_v_word_id = 0; __pyx_v_word_id < __pyx_t_4; __pyx_v_word_id++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":429 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":435 * idmap = IntList(initial_len=N) * for word_id from 0 <= word_id < N: * new_word_id = sym_fromstring(darray.id2word[word_id], True) # <<<<<<<<<<<<<< * idmap.arr[word_id] = new_word_id * return idmap */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_darray->id2word, __pyx_v_word_id, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_darray->id2word, __pyx_v_word_id, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_new_word_id = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_5, 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":430 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":436 * for word_id from 0 <= word_id < N: * new_word_id = sym_fromstring(darray.id2word[word_id], True) * idmap.arr[word_id] = new_word_id # <<<<<<<<<<<<<< @@ -41375,7 +43640,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH (__pyx_v_idmap->arr[__pyx_v_word_id]) = __pyx_v_new_word_id; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":431 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":437 * new_word_id = sym_fromstring(darray.id2word[word_id], True) * idmap.arr[word_id] = new_word_id * return idmap # <<<<<<<<<<<<<< @@ -41387,8 +43652,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH __pyx_r = ((PyObject *)__pyx_v_idmap); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":428 + * self.scorer = scorer + * + * cdef set_idmap(self, DataArray darray): # <<<<<<<<<<<<<< + * cdef int word_id, new_word_id, N + * cdef IntList idmap + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); @@ -41401,6 +43673,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":440 + * + * + * def pattern2phrase(self, pattern): # <<<<<<<<<<<<<< + * # pattern is a tuple, which we must convert to a hiero Phrase + * result = () + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5pattern2phrase(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5pattern2phrase(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { @@ -41408,18 +43688,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5pattern2phra __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pattern2phrase (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phrase(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":434 - * - * - * def pattern2phrase(self, pattern): # <<<<<<<<<<<<<< - * # pattern is a tuple, which we must convert to a hiero Phrase - * result = () - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern) { PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_arity = NULL; @@ -41440,17 +43714,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pattern2phrase", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":436 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":442 * def pattern2phrase(self, pattern): * # pattern is a tuple, which we must convert to a hiero Phrase * result = () # <<<<<<<<<<<<<< * arity = 0 * for word_id in pattern: */ - __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); + __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_result = __pyx_empty_tuple; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":437 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":443 * # pattern is a tuple, which we must convert to a hiero Phrase * result = () * arity = 0 # <<<<<<<<<<<<<< @@ -41460,7 +43734,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra __Pyx_INCREF(__pyx_int_0); __pyx_v_arity = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":438 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":444 * result = () * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -41471,7 +43745,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra __pyx_t_1 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -41479,23 +43753,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -41504,81 +43779,81 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra __Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":439 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":445 * arity = 0 * for word_id in pattern: * if word_id == -1: # <<<<<<<<<<<<<< * arity = arity + 1 * new_id = sym_setindex(self.category, arity) */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":440 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":446 * for word_id in pattern: * if word_id == -1: * arity = arity + 1 # <<<<<<<<<<<<<< * new_id = sym_setindex(self.category, arity) * else: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_arity, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":441 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":447 * if word_id == -1: * arity = arity + 1 * new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<< * else: * 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 = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6); goto __pyx_L5; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":443 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":449 * new_id = sym_setindex(self.category, arity) * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<< * result = result + (new_id,) * return Phrase(result) */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_7, 1); } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":444 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":450 * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) # <<<<<<<<<<<<<< * return Phrase(result) * */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __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); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":445 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":451 * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) * return Phrase(result) # <<<<<<<<<<<<<< @@ -41586,20 +43861,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra * def pattern2phrase_plus(self, pattern): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __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 = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __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_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_1, NULL); 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_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":440 + * + * + * def pattern2phrase(self, pattern): # <<<<<<<<<<<<<< + * # pattern is a tuple, which we must convert to a hiero Phrase + * result = () + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); @@ -41615,6 +43897,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":453 + * return Phrase(result) + * + * def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<< + * # returns a list containing both the pattern, and pattern + * # suffixed/prefixed with the NT category. + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { @@ -41622,18 +43912,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_7pattern2phra __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pattern2phrase_plus (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":447 - * return Phrase(result) - * - * def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<< - * # returns a list containing both the pattern, and pattern - * # suffixed/prefixed with the NT category. - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern) { PyObject *__pyx_v_patterns = NULL; PyObject *__pyx_v_result = NULL; @@ -41656,29 +43940,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pattern2phrase_plus", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":450 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":456 * # returns a list containing both the pattern, and pattern * # suffixed/prefixed with the NT category. * patterns = [] # <<<<<<<<<<<<<< * result = () * arity = 0 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __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 = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_patterns = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":451 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":457 * # suffixed/prefixed with the NT category. * patterns = [] * result = () # <<<<<<<<<<<<<< * arity = 0 * for word_id in pattern: */ - __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); + __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_result = __pyx_empty_tuple; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":452 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":458 * patterns = [] * result = () * arity = 0 # <<<<<<<<<<<<<< @@ -41688,7 +43972,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra __Pyx_INCREF(__pyx_int_0); __pyx_v_arity = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":453 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":459 * result = () * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -41699,7 +43983,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra __pyx_t_1 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -41707,23 +43991,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -41732,155 +44017,155 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra __Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":454 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":460 * arity = 0 * for word_id in pattern: * if word_id == -1: # <<<<<<<<<<<<<< * arity = arity + 1 * new_id = sym_setindex(self.category, arity) */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":455 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":461 * for word_id in pattern: * if word_id == -1: * arity = arity + 1 # <<<<<<<<<<<<<< * new_id = sym_setindex(self.category, arity) * else: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_arity, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":456 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":462 * if word_id == -1: * arity = arity + 1 * new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<< * else: * 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 = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6); goto __pyx_L5; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":458 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":464 * new_id = sym_setindex(self.category, arity) * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<< * result = result + (new_id,) * patterns.append(Phrase(result)) */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_7, 1); } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":459 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":465 * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) # <<<<<<<<<<<<<< * patterns.append(Phrase(result)) * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __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); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":460 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":466 * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) * patterns.append(Phrase(result)) # <<<<<<<<<<<<<< * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __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 = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __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_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":461 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":467 * result = result + (new_id,) * patterns.append(Phrase(result)) * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) # <<<<<<<<<<<<<< * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) * return patterns */ - __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __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 = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":462 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":468 * patterns.append(Phrase(result)) * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) # <<<<<<<<<<<<<< * return patterns * */ - __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __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 = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":463 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":469 * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) * return patterns # <<<<<<<<<<<<<< @@ -41888,12 +44173,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra * def precompute(self): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_patterns)); - __pyx_r = ((PyObject *)__pyx_v_patterns); + __Pyx_INCREF(__pyx_v_patterns); + __pyx_r = __pyx_v_patterns; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":453 + * return Phrase(result) + * + * def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<< + * # returns a list containing both the pattern, and pattern + * # suffixed/prefixed with the NT category. + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); @@ -41910,6 +44202,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":471 + * return patterns + * + * def precompute(self): # <<<<<<<<<<<<<< + * cdef Precomputation pre + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9precompute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9precompute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { @@ -41917,18 +44217,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9precompute(P __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("precompute (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":465 - * return patterns - * - * def precompute(self): # <<<<<<<<<<<<<< - * cdef Precomputation pre - * - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self) { struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *__pyx_v_pre = 0; PyObject *__pyx_v_start_time = NULL; @@ -41956,7 +44250,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("precompute", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":468 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":474 * cdef Precomputation pre * * if self.precompute_file is not None: # <<<<<<<<<<<<<< @@ -41967,64 +44261,64 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":469 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":475 * * if self.precompute_file is not None: * start_time = monitor_cpu() # <<<<<<<<<<<<<< * logger.info("Reading precomputed data from file %s... ", self.precompute_file) * pre = Precomputation(from_binary=self.precompute_file) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_start_time = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":470 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":476 * if self.precompute_file is not None: * start_time = monitor_cpu() * logger.info("Reading precomputed data from file %s... ", self.precompute_file) # <<<<<<<<<<<<<< * pre = Precomputation(from_binary=self.precompute_file) * # check parameters of precomputation -- some are critical and some are not */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_112)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_112)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112)); + __Pyx_INCREF(__pyx_kp_s_Reading_precomputed_data_from_fi); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_Reading_precomputed_data_from_fi); + __Pyx_GIVEREF(__pyx_kp_s_Reading_precomputed_data_from_fi); __Pyx_INCREF(__pyx_v_self->precompute_file); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->precompute_file); __Pyx_GIVEREF(__pyx_v_self->precompute_file); - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __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; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":471 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":477 * start_time = monitor_cpu() * logger.info("Reading precomputed data from file %s... ", self.precompute_file) * pre = Precomputation(from_binary=self.precompute_file) # <<<<<<<<<<<<<< * # check parameters of precomputation -- some are critical and some are not * if pre.max_nonterminals != self.max_nonterminals: */ - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_from_binary, __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Precomputation)), __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_pre = ((struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":473 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":479 * pre = Precomputation(from_binary=self.precompute_file) * # check parameters of precomputation -- some are critical and some are not * if pre.max_nonterminals != self.max_nonterminals: # <<<<<<<<<<<<<< @@ -42034,43 +44328,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = ((__pyx_v_pre->max_nonterminals != __pyx_v_self->max_nonterminals) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":474 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":480 * # check parameters of precomputation -- some are critical and some are not * if pre.max_nonterminals != self.max_nonterminals: * logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals) # <<<<<<<<<<<<<< * if pre.max_length != self.max_length: * logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_113)); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_113)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_113)); + __Pyx_INCREF(__pyx_kp_s_Precomputation_done_with_max_non); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s_Precomputation_done_with_max_non); + __Pyx_GIVEREF(__pyx_kp_s_Precomputation_done_with_max_non); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __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_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4; } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":475 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":481 * if pre.max_nonterminals != self.max_nonterminals: * logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals) * if pre.max_length != self.max_length: # <<<<<<<<<<<<<< @@ -42080,43 +44374,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = ((__pyx_v_pre->max_length != __pyx_v_self->max_length) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":476 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":482 * logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals) * if pre.max_length != self.max_length: * logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) # <<<<<<<<<<<<<< * if pre.train_max_initial_size != self.train_max_initial_size: * raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromLong(__pyx_v_pre->max_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_pre->max_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyInt_FromLong(__pyx_v_self->max_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->max_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_114)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_114)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_114)); + __Pyx_INCREF(__pyx_kp_s_Precomputation_done_with_max_ter); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_Precomputation_done_with_max_ter); + __Pyx_GIVEREF(__pyx_kp_s_Precomputation_done_with_max_ter); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5; } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":477 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":483 * if pre.max_length != self.max_length: * logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) * if pre.train_max_initial_size != self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -42126,18 +44420,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = ((__pyx_v_pre->train_max_initial_size != __pyx_v_self->train_max_initial_size) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":478 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":484 * logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) * if pre.train_max_initial_size != self.train_max_initial_size: * raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) # <<<<<<<<<<<<<< * if pre.train_min_gap_size != self.train_min_gap_size: * raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -42145,25 +44439,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_GIVEREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_115), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Precomputation_done_with_max_ini, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":479 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":485 * if pre.train_max_initial_size != self.train_max_initial_size: * raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) * if pre.train_min_gap_size != self.train_min_gap_size: # <<<<<<<<<<<<<< @@ -42173,18 +44465,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = ((__pyx_v_pre->train_min_gap_size != __pyx_v_self->train_min_gap_size) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":480 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":486 * raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) * if pre.train_min_gap_size != self.train_min_gap_size: * raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) # <<<<<<<<<<<<<< * if self.use_index: * logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -42192,25 +44484,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_GIVEREF(__pyx_t_6); __pyx_t_4 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_116), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Precomputation_done_with_min_gap, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":481 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":487 * if pre.train_min_gap_size != self.train_min_gap_size: * raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) * if self.use_index: # <<<<<<<<<<<<<< @@ -42220,39 +44510,39 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = (__pyx_v_self->use_index != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":482 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":488 * raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) * if self.use_index: * logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) # <<<<<<<<<<<<<< * for pattern, arr in pre.precomputed_index.iteritems(): * phrases = self.pattern2phrase_plus(pattern) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __pyx_v_pre->precomputed_index; __Pyx_INCREF(__pyx_t_6); - __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_117)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_117)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_117)); + __Pyx_INCREF(__pyx_kp_s_Converting_d_hash_keys_on_precom); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_Converting_d_hash_keys_on_precom); + __Pyx_GIVEREF(__pyx_kp_s_Converting_d_hash_keys_on_precom); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":483 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":489 * if self.use_index: * logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) * for pattern, arr in pre.precomputed_index.iteritems(): # <<<<<<<<<<<<<< @@ -42262,9 +44552,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_7 = 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 = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_4; @@ -42272,7 +44562,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, &__pyx_t_4, &__pyx_t_5, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_4); @@ -42280,28 +44570,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":484 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":490 * logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) * for pattern, arr in pre.precomputed_index.iteritems(): * phrases = self.pattern2phrase_plus(pattern) # <<<<<<<<<<<<<< * for phrase in phrases: * self.precomputed_index[phrase] = arr */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pattern2phrase_plus); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __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[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_pattern); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pattern); __Pyx_GIVEREF(__pyx_v_pattern); - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __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; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_phrases, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":485 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":491 * for pattern, arr in pre.precomputed_index.iteritems(): * phrases = self.pattern2phrase_plus(pattern) * for phrase in phrases: # <<<<<<<<<<<<<< @@ -42312,7 +44602,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_3 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_3); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -42320,23 +44610,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_12(__pyx_t_3); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -42345,14 +44636,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_XDECREF_SET(__pyx_v_phrase, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":486 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":492 * phrases = self.pattern2phrase_plus(pattern) * for phrase in phrases: * self.precomputed_index[phrase] = arr # <<<<<<<<<<<<<< * if self.use_collocations: * logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) */ - if (PyObject_SetItem(__pyx_v_self->precomputed_index, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyObject_SetItem(__pyx_v_self->precomputed_index, __pyx_v_phrase, __pyx_v_arr) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -42361,7 +44652,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":487 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":493 * for phrase in phrases: * self.precomputed_index[phrase] = arr * if self.use_collocations: # <<<<<<<<<<<<<< @@ -42371,39 +44662,39 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_2 = (__pyx_v_self->use_collocations != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":488 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":494 * self.precomputed_index[phrase] = arr * if self.use_collocations: * logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) # <<<<<<<<<<<<<< * for pattern, arr in pre.precomputed_collocations.iteritems(): * phrase = self.pattern2phrase(pattern) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __pyx_v_pre->precomputed_collocations; __Pyx_INCREF(__pyx_t_6); - __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_118)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_118)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_118)); + __Pyx_INCREF(__pyx_kp_s_Converting_d_hash_keys_on_precom_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_Converting_d_hash_keys_on_precom_2); + __Pyx_GIVEREF(__pyx_kp_s_Converting_d_hash_keys_on_precom_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":489 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":495 * if self.use_collocations: * logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) * for pattern, arr in pre.precomputed_collocations.iteritems(): # <<<<<<<<<<<<<< @@ -42413,9 +44704,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __pyx_t_8 = 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 = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, __pyx_n_s_iteritems, (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_4; @@ -42423,7 +44714,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_7, &__pyx_t_8, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_4); @@ -42431,87 +44722,96 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":490 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":496 * logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) * for pattern, arr in pre.precomputed_collocations.iteritems(): * phrase = self.pattern2phrase(pattern) # <<<<<<<<<<<<<< * self.precomputed_collocations[phrase] = arr * stop_time = monitor_cpu() */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pattern2phrase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __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[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_pattern); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pattern); __Pyx_GIVEREF(__pyx_v_pattern); - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __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; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_phrase, __pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":491 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":497 * for pattern, arr in pre.precomputed_collocations.iteritems(): * phrase = self.pattern2phrase(pattern) * self.precomputed_collocations[phrase] = arr # <<<<<<<<<<<<<< * stop_time = monitor_cpu() * logger.info("Processing precomputations took %f seconds", stop_time - start_time) */ - if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase, __pyx_v_arr) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13; } __pyx_L13:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":492 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":498 * phrase = self.pattern2phrase(pattern) * self.precomputed_collocations[phrase] = arr * stop_time = monitor_cpu() # <<<<<<<<<<<<<< * logger.info("Processing precomputations took %f seconds", stop_time - start_time) * */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_stop_time = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":493 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":499 * self.precomputed_collocations[phrase] = arr * stop_time = monitor_cpu() * logger.info("Processing precomputations took %f seconds", stop_time - start_time) # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Subtract(__pyx_v_stop_time, __pyx_v_start_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_stop_time, __pyx_v_start_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __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[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_119)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_119)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_119)); + __Pyx_INCREF(__pyx_kp_s_Processing_precomputations_took); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_Processing_precomputations_took); + __Pyx_GIVEREF(__pyx_kp_s_Processing_precomputations_took); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L3; } __pyx_L3:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":471 + * return patterns + * + * def precompute(self): # <<<<<<<<<<<<<< + * cdef Precomputation pre + * + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -42534,6 +44834,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":502 + * + * + * def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<< + * if phrase in self.precomputed_collocations: + * arr = self.precomputed_collocations[phrase] + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_11get_precomputed_collocation(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_11get_precomputed_collocation(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase) { @@ -42541,18 +44849,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_11get_precomp __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_precomputed_collocation (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomputed_collocation(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_phrase)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":496 - * - * - * def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<< - * if phrase in self.precomputed_collocations: - * arr = self.precomputed_collocations[phrase] - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomputed_collocation(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_phrase) { PyObject *__pyx_v_arr = NULL; PyObject *__pyx_r = NULL; @@ -42568,30 +44870,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_precomputed_collocation", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":497 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":503 * * def get_precomputed_collocation(self, phrase): * if phrase in self.precomputed_collocations: # <<<<<<<<<<<<<< * arr = self.precomputed_collocations[phrase] * return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) */ - __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_phrase, __pyx_v_self->precomputed_collocations, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_phrase, __pyx_v_self->precomputed_collocations, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":498 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":504 * def get_precomputed_collocation(self, phrase): * if phrase in self.precomputed_collocations: * arr = self.precomputed_collocations[phrase] # <<<<<<<<<<<<<< * return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) * return None */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_v_arr = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":499 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":505 * if phrase in self.precomputed_collocations: * arr = self.precomputed_collocations[phrase] * return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) # <<<<<<<<<<<<<< @@ -42599,36 +44901,34 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr), __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arr, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arr_low, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arr_high, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_phrase, __pyx_n_s_arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_num_subpatterns, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":500 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":506 * arr = self.precomputed_collocations[phrase] * return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) * return None # <<<<<<<<<<<<<< @@ -42640,8 +44940,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp __pyx_r = Py_None; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":502 + * + * + * def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<< + * if phrase in self.precomputed_collocations: + * arr = self.precomputed_collocations[phrase] + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); @@ -42655,7 +44962,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":503 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":509 * * * cdef int* baeza_yates_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -42701,7 +45008,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("baeza_yates_helper", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":516 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":522 * cdef Matching loc1, loc2 * * result = malloc(0*sizeof(int*)) # <<<<<<<<<<<<<< @@ -42710,7 +45017,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_result = ((int *)malloc((0 * (sizeof(int *))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":518 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":524 * result = malloc(0*sizeof(int*)) * * d_first = 0 # <<<<<<<<<<<<<< @@ -42719,7 +45026,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_d_first = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":519 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":525 * * d_first = 0 * if high1 - low1 > high2 - low2: # <<<<<<<<<<<<<< @@ -42729,7 +45036,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_1 = (((__pyx_v_high1 - __pyx_v_low1) > (__pyx_v_high2 - __pyx_v_low2)) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":520 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":526 * d_first = 0 * if high1 - low1 > high2 - low2: * d_first = 1 # <<<<<<<<<<<<<< @@ -42741,7 +45048,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":524 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":530 * # First, check to see if we are at any of the recursive base cases * # Case 1: one of the sets is empty * if low1 >= high1 or low2 >= high2: # <<<<<<<<<<<<<< @@ -42757,7 +45064,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":525 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":531 * # Case 1: one of the sets is empty * if low1 >= high1 or low2 >= high2: * return result # <<<<<<<<<<<<<< @@ -42766,11 +45073,9 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_r = __pyx_v_result; goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":528 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":534 * * # Case 2: sets are non-overlapping * assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42779,7 +45084,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":529 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":535 * # Case 2: sets are non-overlapping * assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) * assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42788,7 +45093,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_low2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":530 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":536 * assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) * assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == -1: # <<<<<<<<<<<<<< @@ -42798,7 +45103,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":531 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":537 * assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == -1: * return result # <<<<<<<<<<<<<< @@ -42807,11 +45112,9 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_r = __pyx_v_result; goto __pyx_L0; - goto __pyx_L5; } - __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":533 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":539 * return result * * assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42820,7 +45123,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_low1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":534 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":540 * * assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) * assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42829,7 +45132,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":535 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":541 * assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) * assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: # <<<<<<<<<<<<<< @@ -42839,7 +45142,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":536 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":542 * assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: * return result # <<<<<<<<<<<<<< @@ -42848,11 +45151,9 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_r = __pyx_v_result; goto __pyx_L0; - goto __pyx_L6; } - __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":540 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":546 * # Case 3: query set and data set do not meet size mismatch constraints; * # We use mergesort instead in this case * qsetsize = (high1-low1) / step1 # <<<<<<<<<<<<<< @@ -42864,25 +45165,25 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step1 == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) { + else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_step1 == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_OverflowError, "value too large to perform division"); + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_qsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":541 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":547 * # We use mergesort instead in this case * qsetsize = (high1-low1) / step1 * dsetsize = (high2-low2) / step2 # <<<<<<<<<<<<<< @@ -42894,25 +45195,25 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step2 == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) { + else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_step2 == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_OverflowError, "value too large to perform division"); + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_dsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":542 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":548 * qsetsize = (high1-low1) / step1 * dsetsize = (high2-low2) / step2 * if d_first: # <<<<<<<<<<<<<< @@ -42922,7 +45223,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = (__pyx_v_d_first != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":543 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":549 * dsetsize = (high2-low2) / step2 * if d_first: * tmp = qsetsize # <<<<<<<<<<<<<< @@ -42931,7 +45232,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_tmp = __pyx_v_qsetsize; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":544 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":550 * if d_first: * tmp = qsetsize * qsetsize = dsetsize # <<<<<<<<<<<<<< @@ -42940,7 +45241,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_qsetsize = __pyx_v_dsetsize; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":545 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":551 * tmp = qsetsize * qsetsize = dsetsize * dsetsize = tmp # <<<<<<<<<<<<<< @@ -42952,7 +45253,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":547 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":553 * dsetsize = tmp * * if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: # <<<<<<<<<<<<<< @@ -42965,16 +45266,16 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_3 = (((__pyx_t_5 / __pyx_t_6) > __pyx_v_dsetsize) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":548 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":554 * * if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: * free(result) # <<<<<<<<<<<<<< @@ -42983,7 +45284,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ free(__pyx_v_result); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":549 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":555 * if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: * free(result) * return self.merge_helper(low1, high1, arr1, step1, low2, high2, arr2, step2, offset_by_one, len_last, num_subpatterns, result_len) # <<<<<<<<<<<<<< @@ -42992,11 +45293,9 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_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; } - __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":553 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":559 * # binary search. There are two flavors, depending on * # whether the queryset or dataset is first * if d_first: # <<<<<<<<<<<<<< @@ -43006,7 +45305,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = (__pyx_v_d_first != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":554 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":560 * # whether the queryset or dataset is first * if d_first: * med2 = median(low2, high2, step2) # <<<<<<<<<<<<<< @@ -43015,7 +45314,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_low2, __pyx_v_high2, __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":555 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":561 * if d_first: * med2 = median(low2, high2, step2) * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43024,7 +45323,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":557 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":563 * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) * * search_low = low1 # <<<<<<<<<<<<<< @@ -43033,7 +45332,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_search_low = __pyx_v_low1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":558 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":564 * * search_low = low1 * search_high = high1 # <<<<<<<<<<<<<< @@ -43042,7 +45341,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_search_high = __pyx_v_high1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":559 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":565 * search_low = low1 * search_high = high1 * while search_low < search_high: # <<<<<<<<<<<<<< @@ -43053,7 +45352,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_search_low < __pyx_v_search_high) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":560 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":566 * search_high = high1 * while search_low < search_high: * med1 = median(search_low, search_high, step1) # <<<<<<<<<<<<<< @@ -43062,7 +45361,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med1 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":561 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":567 * while search_low < search_high: * med1 = median(search_low, search_high, step1) * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<< @@ -43071,7 +45370,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":562 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":568 * med1 = median(search_low, search_high, step1) * 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) # <<<<<<<<<<<<<< @@ -43080,7 +45379,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":565 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":571 * if comparison == -1: * search_low = med1_plus * elif comparison == 1: # <<<<<<<<<<<<<< @@ -43089,7 +45388,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ switch (__pyx_v_comparison) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":563 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":569 * 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) * if comparison == -1: # <<<<<<<<<<<<<< @@ -43098,7 +45397,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ case -1: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":564 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":570 * comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) * if comparison == -1: * search_low = med1_plus # <<<<<<<<<<<<<< @@ -43108,7 +45407,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_v_search_low = __pyx_v_med1_plus; break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":565 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":571 * if comparison == -1: * search_low = med1_plus * elif comparison == 1: # <<<<<<<<<<<<<< @@ -43117,7 +45416,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ case 1: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":566 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":572 * search_low = med1_plus * elif comparison == 1: * search_high = med1_minus # <<<<<<<<<<<<<< @@ -43128,7 +45427,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( break; default: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":568 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":574 * search_high = med1_minus * else: * break # <<<<<<<<<<<<<< @@ -43144,7 +45443,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":570 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":576 * break * else: * med1 = median(low1, high1, step1) # <<<<<<<<<<<<<< @@ -43153,7 +45452,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med1 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_low1, __pyx_v_high1, __pyx_v_step1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":571 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":577 * else: * med1 = median(low1, high1, step1) * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<< @@ -43162,7 +45461,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":573 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":579 * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) * * search_low = low2 # <<<<<<<<<<<<<< @@ -43171,7 +45470,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_search_low = __pyx_v_low2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":574 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":580 * * search_low = low2 * search_high = high2 # <<<<<<<<<<<<<< @@ -43180,7 +45479,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_search_high = __pyx_v_high2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":575 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":581 * search_low = low2 * search_high = high2 * while search_low < search_high: # <<<<<<<<<<<<<< @@ -43191,7 +45490,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_search_low < __pyx_v_search_high) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":576 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":582 * search_high = high2 * while search_low < search_high: * med2 = median(search_low, search_high, step2) # <<<<<<<<<<<<<< @@ -43200,7 +45499,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":577 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":583 * while search_low < search_high: * med2 = median(search_low, search_high, step2) * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43209,7 +45508,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":578 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":584 * med2 = median(search_low, search_high, step2) * 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) # <<<<<<<<<<<<<< @@ -43218,7 +45517,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":581 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":587 * if comparison == -1: * search_high = med2 * elif comparison == 1: # <<<<<<<<<<<<<< @@ -43227,7 +45526,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ switch (__pyx_v_comparison) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":579 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":585 * 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) * if comparison == -1: # <<<<<<<<<<<<<< @@ -43236,7 +45535,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ case -1: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":580 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":586 * comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) * if comparison == -1: * search_high = med2 # <<<<<<<<<<<<<< @@ -43246,7 +45545,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_v_search_high = __pyx_v_med2; break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":581 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":587 * if comparison == -1: * search_high = med2 * elif comparison == 1: # <<<<<<<<<<<<<< @@ -43255,7 +45554,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ case 1: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":582 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":588 * search_high = med2 * elif comparison == 1: * search_low = med2 + step2 # <<<<<<<<<<<<<< @@ -43266,7 +45565,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( break; default: - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":584 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":590 * search_low = med2 + step2 * else: * break # <<<<<<<<<<<<<< @@ -43281,7 +45580,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":586 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":592 * break * * med_result_len = 0 # <<<<<<<<<<<<<< @@ -43290,7 +45589,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med_result_len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":587 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":593 * * med_result_len = 0 * med_result = malloc(0*sizeof(int*)) # <<<<<<<<<<<<<< @@ -43299,7 +45598,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med_result = ((int *)malloc((0 * (sizeof(int *))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":588 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":594 * med_result_len = 0 * med_result = malloc(0*sizeof(int*)) * if search_high > search_low: # <<<<<<<<<<<<<< @@ -43309,7 +45608,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_search_high > __pyx_v_search_low) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":594 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":600 * # want to store the bindings for all of those elements. We can * # subsequently throw all of them away. * med2_minus = med2 # <<<<<<<<<<<<<< @@ -43318,7 +45617,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_minus = __pyx_v_med2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":595 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":601 * # subsequently throw all of them away. * med2_minus = med2 * med2_plus = med2 + step2 # <<<<<<<<<<<<<< @@ -43327,7 +45626,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_plus = (__pyx_v_med2 + __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":596 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":602 * med2_minus = med2 * med2_plus = med2 + step2 * i1 = med1_minus # <<<<<<<<<<<<<< @@ -43336,7 +45635,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_i1 = __pyx_v_med1_minus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":597 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":603 * med2_plus = med2 + step2 * i1 = med1_minus * while i1 < med1_plus: # <<<<<<<<<<<<<< @@ -43347,7 +45646,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_i1 < __pyx_v_med1_plus) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":598 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":604 * i1 = med1_minus * while i1 < med1_plus: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43356,7 +45655,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":599 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":605 * while i1 < med1_plus: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while med2_minus-step2 >= low2: # <<<<<<<<<<<<<< @@ -43367,7 +45666,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = (((__pyx_v_med2_minus - __pyx_v_step2) >= __pyx_v_low2) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":600 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":606 * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while med2_minus-step2 >= low2: * assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43376,7 +45675,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":601 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":607 * while med2_minus-step2 >= low2: * assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) < 1: # <<<<<<<<<<<<<< @@ -43386,7 +45685,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":602 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":608 * assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) < 1: * med2_minus = med2_minus - step2 # <<<<<<<<<<<<<< @@ -43398,7 +45697,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":604 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":610 * med2_minus = med2_minus - step2 * else: * break # <<<<<<<<<<<<<< @@ -43411,7 +45710,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L18_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":605 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":611 * else: * break * i2 = med2_minus # <<<<<<<<<<<<<< @@ -43420,7 +45719,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_i2 = __pyx_v_med2_minus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":606 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":612 * break * i2 = med2_minus * while i2 < high2: # <<<<<<<<<<<<<< @@ -43431,7 +45730,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_i2 < __pyx_v_high2) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":607 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":613 * i2 = med2_minus * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43440,7 +45739,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":608 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":614 * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<< @@ -43449,7 +45748,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":609 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":615 * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) * if comparison == 0: # <<<<<<<<<<<<<< @@ -43459,7 +45758,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_comparison == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":611 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":617 * if comparison == 0: * pass * med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) # <<<<<<<<<<<<<< @@ -43471,7 +45770,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L22:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":612 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":618 * pass * med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) * if comparison == -1: # <<<<<<<<<<<<<< @@ -43481,7 +45780,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_comparison == -1) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":613 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":619 * med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) * if comparison == -1: * break # <<<<<<<<<<<<<< @@ -43489,11 +45788,9 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( * if i2 > med2_plus: */ goto __pyx_L21_break; - goto __pyx_L23; } - __pyx_L23:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":614 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":620 * if comparison == -1: * break * i2 = i2 + step2 # <<<<<<<<<<<<<< @@ -43504,7 +45801,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L21_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":615 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":621 * break * i2 = i2 + step2 * if i2 > med2_plus: # <<<<<<<<<<<<<< @@ -43514,7 +45811,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_i2 > __pyx_v_med2_plus) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":616 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":622 * i2 = i2 + step2 * if i2 > med2_plus: * med2_plus = i2 # <<<<<<<<<<<<<< @@ -43526,7 +45823,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":617 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":623 * if i2 > med2_plus: * med2_plus = i2 * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -43536,7 +45833,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_v_i1 = (__pyx_v_i1 + __pyx_v_step1); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":619 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":625 * i1 = i1 + step1 * * tmp = med1_minus # <<<<<<<<<<<<<< @@ -43545,7 +45842,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_tmp = __pyx_v_med1_minus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":620 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":626 * * tmp = med1_minus * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -43554,7 +45851,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med1_minus = __pyx_v_med1_plus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":621 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":627 * tmp = med1_minus * med1_minus = med1_plus * med1_plus = tmp # <<<<<<<<<<<<<< @@ -43566,7 +45863,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":624 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":630 * else: * # No match; need to figure out the point of division in D and Q * med2_minus = med2 # <<<<<<<<<<<<<< @@ -43575,7 +45872,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_minus = __pyx_v_med2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":625 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":631 * # No match; need to figure out the point of division in D and Q * med2_minus = med2 * med2_plus = med2 # <<<<<<<<<<<<<< @@ -43584,7 +45881,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_plus = __pyx_v_med2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":626 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":632 * med2_minus = med2 * med2_plus = med2 * if d_first: # <<<<<<<<<<<<<< @@ -43594,7 +45891,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = (__pyx_v_d_first != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":627 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":633 * med2_plus = med2 * if d_first: * med2_minus = med2_minus + step2 # <<<<<<<<<<<<<< @@ -43603,7 +45900,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":628 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":634 * if d_first: * med2_minus = med2_minus + step2 * if comparison == -1: # <<<<<<<<<<<<<< @@ -43613,7 +45910,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_comparison == -1) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":629 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":635 * med2_minus = med2_minus + step2 * if comparison == -1: * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -43625,7 +45922,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L26:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":630 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":636 * if comparison == -1: * med1_minus = med1_plus * if comparison == 1: # <<<<<<<<<<<<<< @@ -43635,7 +45932,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_comparison == 1) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":631 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":637 * med1_minus = med1_plus * if comparison == 1: * med1_plus = med1_minus # <<<<<<<<<<<<<< @@ -43650,7 +45947,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":633 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":639 * med1_plus = med1_minus * else: * tmp = med1_minus # <<<<<<<<<<<<<< @@ -43659,7 +45956,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_tmp = __pyx_v_med1_minus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":634 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":640 * else: * tmp = med1_minus * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -43668,7 +45965,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med1_minus = __pyx_v_med1_plus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":635 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":641 * tmp = med1_minus * med1_minus = med1_plus * med1_plus = tmp # <<<<<<<<<<<<<< @@ -43677,7 +45974,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med1_plus = __pyx_v_tmp; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":636 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":642 * med1_minus = med1_plus * med1_plus = tmp * if comparison == 1: # <<<<<<<<<<<<<< @@ -43687,7 +45984,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_t_3 = ((__pyx_v_comparison == 1) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":637 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":643 * med1_plus = tmp * if comparison == 1: * med2_minus = med2_minus + step2 # <<<<<<<<<<<<<< @@ -43696,7 +45993,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":638 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":644 * if comparison == 1: * med2_minus = med2_minus + step2 * med2_plus = med2_plus + step2 # <<<<<<<<<<<<<< @@ -43712,7 +46009,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( } __pyx_L14:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":640 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":646 * med2_plus = med2_plus + step2 * * low_result_len = 0 # <<<<<<<<<<<<<< @@ -43721,7 +46018,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_low_result_len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":641 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":647 * * low_result_len = 0 * low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len) # <<<<<<<<<<<<<< @@ -43730,7 +46027,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_low_result = ((struct __pyx_vtabstruct_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":642 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":648 * low_result_len = 0 * low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len) * high_result_len = 0 # <<<<<<<<<<<<<< @@ -43739,7 +46036,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_high_result_len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":643 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":649 * low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len) * 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) # <<<<<<<<<<<<<< @@ -43748,7 +46045,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_high_result = ((struct __pyx_vtabstruct_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":645 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":651 * 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) * * result = extend_arr(result, result_len, low_result, low_result_len) # <<<<<<<<<<<<<< @@ -43757,7 +46054,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_low_result, __pyx_v_low_result_len); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":646 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":652 * * result = extend_arr(result, result_len, low_result, low_result_len) * result = extend_arr(result, result_len, med_result, med_result_len) # <<<<<<<<<<<<<< @@ -43766,7 +46063,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_med_result, __pyx_v_med_result_len); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":647 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":653 * result = extend_arr(result, result_len, low_result, low_result_len) * result = extend_arr(result, result_len, med_result, med_result_len) * result = extend_arr(result, result_len, high_result, high_result_len) # <<<<<<<<<<<<<< @@ -43775,7 +46072,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ __pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_high_result, __pyx_v_high_result_len); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":648 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":654 * result = extend_arr(result, result_len, med_result, med_result_len) * result = extend_arr(result, result_len, high_result, high_result_len) * free(low_result) # <<<<<<<<<<<<<< @@ -43784,7 +46081,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ free(__pyx_v_low_result); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":649 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":655 * result = extend_arr(result, result_len, high_result, high_result_len) * free(low_result) * free(med_result) # <<<<<<<<<<<<<< @@ -43793,7 +46090,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ free(__pyx_v_med_result); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":650 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":656 * free(low_result) * free(med_result) * free(high_result) # <<<<<<<<<<<<<< @@ -43802,7 +46099,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( */ free(__pyx_v_high_result); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":652 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":658 * free(high_result) * * return result # <<<<<<<<<<<<<< @@ -43812,17 +46109,24 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper( __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = 0; - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":509 + * + * + * cdef int* baeza_yates_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<< + * int low2, int high2, int* arr2, int step2, + * int offset_by_one, int len_last, int num_subpatterns, int* result_len): + */ + + /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("cdec.sa._sa.HieroCachingRuleFactory.baeza_yates_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.HieroCachingRuleFactory.baeza_yates_helper", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":656 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":662 * * * cdef long compare_matchings_set(self, int i1_minus, int i1_plus, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -43841,7 +46145,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s int __pyx_t_1; __Pyx_RefNannySetupContext("compare_matchings_set", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":667 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":673 * cdef Matching* loc1 * * loc1 = &l1_stack # <<<<<<<<<<<<<< @@ -43850,7 +46154,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_v_loc1 = (&__pyx_v_l1_stack); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":669 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":675 * loc1 = &l1_stack * * i1 = i1_minus # <<<<<<<<<<<<<< @@ -43859,7 +46163,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_v_i1 = __pyx_v_i1_minus; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":670 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":676 * * i1 = i1_minus * while i1 < i1_plus: # <<<<<<<<<<<<<< @@ -43870,7 +46174,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s __pyx_t_1 = ((__pyx_v_i1 < __pyx_v_i1_plus) != 0); if (!__pyx_t_1) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":671 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":677 * i1 = i1_minus * while i1 < i1_plus: * assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43879,7 +46183,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_f_4cdec_2sa_3_sa_assign_matching(__pyx_v_loc1, __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":672 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":678 * while i1 < i1_plus: * assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) * comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) # <<<<<<<<<<<<<< @@ -43888,7 +46192,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":673 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":679 * assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) * comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) * if comparison == 0: # <<<<<<<<<<<<<< @@ -43898,7 +46202,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s __pyx_t_1 = ((__pyx_v_comparison == 0) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":674 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":680 * comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) * if comparison == 0: * prev_comparison = 0 # <<<<<<<<<<<<<< @@ -43907,7 +46211,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_v_prev_comparison = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":675 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":681 * if comparison == 0: * prev_comparison = 0 * break # <<<<<<<<<<<<<< @@ -43915,10 +46219,9 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s * prev_comparison = comparison */ goto __pyx_L4_break; - goto __pyx_L5; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":676 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":682 * prev_comparison = 0 * break * elif i1 == i1_minus: # <<<<<<<<<<<<<< @@ -43928,7 +46231,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s __pyx_t_1 = ((__pyx_v_i1 == __pyx_v_i1_minus) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":677 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":683 * break * elif i1 == i1_minus: * prev_comparison = comparison # <<<<<<<<<<<<<< @@ -43940,7 +46243,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":679 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":685 * prev_comparison = comparison * else: * if comparison != prev_comparison: # <<<<<<<<<<<<<< @@ -43950,7 +46253,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s __pyx_t_1 = ((__pyx_v_comparison != __pyx_v_prev_comparison) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":680 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":686 * else: * if comparison != prev_comparison: * prev_comparison = 0 # <<<<<<<<<<<<<< @@ -43959,7 +46262,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s */ __pyx_v_prev_comparison = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":681 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":687 * if comparison != prev_comparison: * prev_comparison = 0 * break # <<<<<<<<<<<<<< @@ -43967,13 +46270,11 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s * return prev_comparison */ goto __pyx_L4_break; - goto __pyx_L6; } - __pyx_L6:; } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":682 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":688 * prev_comparison = 0 * break * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -43984,7 +46285,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s } __pyx_L4_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":683 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":689 * break * i1 = i1 + step1 * return prev_comparison # <<<<<<<<<<<<<< @@ -43994,13 +46295,21 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s __pyx_r = __pyx_v_prev_comparison; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":662 + * + * + * cdef long compare_matchings_set(self, int i1_minus, int i1_plus, int* arr1, int step1, # <<<<<<<<<<<<<< + * Matching* loc2, int offset_by_one, int len_last): + * """ + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":686 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":692 * * * cdef long compare_matchings(self, Matching* loc1, Matching* loc2, int offset_by_one, int len_last): # <<<<<<<<<<<<<< @@ -44018,7 +46327,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s int __pyx_t_4; __Pyx_RefNannySetupContext("compare_matchings", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":689 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":695 * cdef int i * * if loc1.sent_id > loc2.sent_id: # <<<<<<<<<<<<<< @@ -44028,7 +46337,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_1 = ((__pyx_v_loc1->sent_id > __pyx_v_loc2->sent_id) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":690 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":696 * * if loc1.sent_id > loc2.sent_id: * return 1 # <<<<<<<<<<<<<< @@ -44037,11 +46346,9 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":691 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":697 * if loc1.sent_id > loc2.sent_id: * return 1 * if loc2.sent_id > loc1.sent_id: # <<<<<<<<<<<<<< @@ -44051,7 +46358,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_1 = ((__pyx_v_loc2->sent_id > __pyx_v_loc1->sent_id) != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":692 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":698 * return 1 * if loc2.sent_id > loc1.sent_id: * return -1 # <<<<<<<<<<<<<< @@ -44060,11 +46367,9 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s */ __pyx_r = -1; goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":694 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":700 * return -1 * * if loc1.size == 1 and loc2.size == 1: # <<<<<<<<<<<<<< @@ -44080,7 +46385,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":695 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":701 * * if loc1.size == 1 and loc2.size == 1: * if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size: # <<<<<<<<<<<<<< @@ -44090,7 +46395,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = ((((__pyx_v_loc2->arr[__pyx_v_loc2->start]) - (__pyx_v_loc1->arr[__pyx_v_loc1->start])) <= __pyx_v_self->train_min_gap_size) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":696 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":702 * if loc1.size == 1 and loc2.size == 1: * if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size: * return 1 # <<<<<<<<<<<<<< @@ -44099,13 +46404,11 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L6; } - __pyx_L6:; goto __pyx_L5; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":698 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":704 * return 1 * * elif offset_by_one: # <<<<<<<<<<<<<< @@ -44115,7 +46418,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (__pyx_v_offset_by_one != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":699 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":705 * * elif offset_by_one: * for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -44125,7 +46428,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_4 = __pyx_v_loc1->size; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":700 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":706 * elif offset_by_one: * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<< @@ -44135,7 +46438,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) > (__pyx_v_loc2->arr[((__pyx_v_loc2->start + __pyx_v_i) - 1)])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":701 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":707 * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: * return 1 # <<<<<<<<<<<<<< @@ -44144,11 +46447,9 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L9; } - __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":702 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":708 * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<< @@ -44158,7 +46459,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) < (__pyx_v_loc2->arr[((__pyx_v_loc2->start + __pyx_v_i) - 1)])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":703 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":709 * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]: * return -1 # <<<<<<<<<<<<<< @@ -44167,15 +46468,13 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s */ __pyx_r = -1; goto __pyx_L0; - goto __pyx_L10; } - __pyx_L10:; } goto __pyx_L5; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":706 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":712 * * else: * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: # <<<<<<<<<<<<<< @@ -44185,7 +46484,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = ((((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) > (__pyx_v_loc2->arr[__pyx_v_loc2->start])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":707 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":713 * else: * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: * return 1 # <<<<<<<<<<<<<< @@ -44194,11 +46493,9 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L11; } - __pyx_L11:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":708 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":714 * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: * return 1 * if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: # <<<<<<<<<<<<<< @@ -44208,7 +46505,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = ((((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) < (__pyx_v_loc2->arr[__pyx_v_loc2->start])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":709 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":715 * return 1 * if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: * return -1 # <<<<<<<<<<<<<< @@ -44217,11 +46514,9 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s */ __pyx_r = -1; goto __pyx_L0; - goto __pyx_L12; } - __pyx_L12:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":711 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":717 * return -1 * * for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -44231,7 +46526,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_4 = __pyx_v_loc1->size; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":712 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":718 * * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<< @@ -44241,7 +46536,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) > (__pyx_v_loc2->arr[(__pyx_v_loc2->start + __pyx_v_i)])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":713 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":719 * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: * return 1 # <<<<<<<<<<<<<< @@ -44250,11 +46545,9 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L15; } - __pyx_L15:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":714 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":720 * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<< @@ -44264,7 +46557,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) < (__pyx_v_loc2->arr[(__pyx_v_loc2->start + __pyx_v_i)])) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":715 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":721 * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: * return -1 # <<<<<<<<<<<<<< @@ -44273,14 +46566,12 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s */ __pyx_r = -1; goto __pyx_L0; - goto __pyx_L16; } - __pyx_L16:; } } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":717 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":723 * return -1 * * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -44290,7 +46581,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_t_3 = (((((__pyx_v_loc2->arr[(__pyx_v_loc2->end - 1)]) + __pyx_v_len_last) - (__pyx_v_loc1->arr[__pyx_v_loc1->start])) > __pyx_v_self->train_max_initial_size) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":718 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":724 * * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: * return -1 # <<<<<<<<<<<<<< @@ -44299,11 +46590,9 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s */ __pyx_r = -1; goto __pyx_L0; - goto __pyx_L17; } - __pyx_L17:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":719 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":725 * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: * return -1 * return 0 # <<<<<<<<<<<<<< @@ -44313,13 +46602,21 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s __pyx_r = 0; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":692 + * + * + * cdef long compare_matchings(self, Matching* loc1, Matching* loc2, int offset_by_one, int len_last): # <<<<<<<<<<<<<< + * cdef int i + * + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":722 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":728 * * * cdef int* merge_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -44343,7 +46640,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct int __pyx_t_3; __Pyx_RefNannySetupContext("merge_helper", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":730 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":736 * cdef Matching loc1, loc2 * * result_len[0] = 0 # <<<<<<<<<<<<<< @@ -44352,7 +46649,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ (__pyx_v_result_len[0]) = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":731 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":737 * * result_len[0] = 0 * result = malloc(0*sizeof(int)) # <<<<<<<<<<<<<< @@ -44361,7 +46658,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_result = ((int *)malloc((0 * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":733 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":739 * result = malloc(0*sizeof(int)) * * i1 = low1 # <<<<<<<<<<<<<< @@ -44370,7 +46667,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_i1 = __pyx_v_low1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":734 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":740 * * i1 = low1 * i2 = low2 # <<<<<<<<<<<<<< @@ -44379,7 +46676,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_i2 = __pyx_v_low2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":735 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":741 * i1 = low1 * i2 = low2 * while i1 < high1 and i2 < high2: # <<<<<<<<<<<<<< @@ -44396,7 +46693,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":738 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":744 * * # First, pop all unneeded loc2's off the stack * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -44405,7 +46702,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":739 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":745 * # First, pop all unneeded loc2's off the stack * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while i2 < high2: # <<<<<<<<<<<<<< @@ -44416,7 +46713,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_t_3 = ((__pyx_v_i2 < __pyx_v_high2) != 0); if (!__pyx_t_3) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":740 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":746 * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -44425,7 +46722,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":741 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":747 * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: # <<<<<<<<<<<<<< @@ -44435,7 +46732,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":742 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":748 * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: * i2 = i2 + step2 # <<<<<<<<<<<<<< @@ -44447,7 +46744,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":744 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":750 * i2 = i2 + step2 * else: * break # <<<<<<<<<<<<<< @@ -44460,7 +46757,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } __pyx_L6_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":747 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":753 * * # Next: process all loc1's with the same starting val * j1 = i1 # <<<<<<<<<<<<<< @@ -44469,7 +46766,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_j1 = __pyx_v_i1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":748 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":754 * # Next: process all loc1's with the same starting val * j1 = i1 * while i1 < high1 and arr1[j1] == arr1[i1]: # <<<<<<<<<<<<<< @@ -44486,7 +46783,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":749 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":755 * j1 = i1 * while i1 < high1 and arr1[j1] == arr1[i1]: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -44495,7 +46792,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":750 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":756 * while i1 < high1 and arr1[j1] == arr1[i1]: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * j2 = i2 # <<<<<<<<<<<<<< @@ -44504,7 +46801,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_j2 = __pyx_v_i2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":751 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":757 * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * j2 = i2 * while j2 < high2: # <<<<<<<<<<<<<< @@ -44515,7 +46812,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_t_2 = ((__pyx_v_j2 < __pyx_v_high2) != 0); if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":752 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":758 * j2 = i2 * while j2 < high2: * assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -44524,7 +46821,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_j2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":753 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":759 * while j2 < high2: * assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<< @@ -44533,7 +46830,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":754 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":760 * assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) * if comparison == 0: # <<<<<<<<<<<<<< @@ -44543,7 +46840,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_t_2 = ((__pyx_v_comparison == 0) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":755 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":761 * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) * if comparison == 0: * result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len) # <<<<<<<<<<<<<< @@ -44555,7 +46852,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } __pyx_L12:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":756 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":762 * if comparison == 0: * result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len) * if comparison == 1: # <<<<<<<<<<<<<< @@ -44568,7 +46865,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } __pyx_L13:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":758 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":764 * if comparison == 1: * pass * if comparison == -1: # <<<<<<<<<<<<<< @@ -44578,7 +46875,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_t_2 = ((__pyx_v_comparison == -1) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":759 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":765 * pass * if comparison == -1: * break # <<<<<<<<<<<<<< @@ -44586,11 +46883,10 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct * j2 = j2 + step2 */ goto __pyx_L11_break; - goto __pyx_L14; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":761 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":767 * break * else: * j2 = j2 + step2 # <<<<<<<<<<<<<< @@ -44599,11 +46895,10 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct */ __pyx_v_j2 = (__pyx_v_j2 + __pyx_v_step2); } - __pyx_L14:; } __pyx_L11_break:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":762 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":768 * else: * j2 = j2 + step2 * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -44614,7 +46909,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct } } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":763 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":769 * j2 = j2 + step2 * i1 = i1 + step1 * return result # <<<<<<<<<<<<<< @@ -44624,13 +46919,21 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":728 + * + * + * cdef int* merge_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<< + * int low2, int high2, int* arr2, int step2, + * int offset_by_one, int len_last, int num_subpatterns, int* result_len): + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":766 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":772 * * * cdef void sort_phrase_loc(self, IntList arr, PhraseLocation loc, Phrase phrase): # <<<<<<<<<<<<<< @@ -44653,27 +46956,27 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sort_phrase_loc", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":771 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":777 * cdef IntList result * * if phrase in self.precomputed_index: # <<<<<<<<<<<<<< * loc.arr = self.precomputed_index[phrase] * else: */ - __pyx_t_1 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_phrase), __pyx_v_self->precomputed_index, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_phrase), __pyx_v_self->precomputed_index, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":772 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":778 * * if phrase in self.precomputed_index: * loc.arr = self.precomputed_index[phrase] # <<<<<<<<<<<<<< * else: * loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 778; __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_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_loc->arr); __Pyx_DECREF(((PyObject *)__pyx_v_loc->arr)); @@ -44683,49 +46986,49 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":774 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":780 * loc.arr = self.precomputed_index[phrase] * else: * loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) # <<<<<<<<<<<<<< * veb = VEB(arr.len) * for i from loc.sa_low <= i < loc.sa_high: */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_initial_len, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_loc->arr); __Pyx_DECREF(((PyObject *)__pyx_v_loc->arr)); __pyx_v_loc->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":775 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":781 * else: * loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) * veb = VEB(arr.len) # <<<<<<<<<<<<<< * for i from loc.sa_low <= i < loc.sa_high: * veb._insert(arr.arr[i]) */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_arr->len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 781; __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[8]; __pyx_lineno = 775; __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 = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_VEB)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_VEB)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_veb = ((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":776 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":782 * loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) * veb = VEB(arr.len) * for i from loc.sa_low <= i < loc.sa_high: # <<<<<<<<<<<<<< @@ -44735,7 +47038,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str __pyx_t_5 = __pyx_v_loc->sa_high; for (__pyx_v_i = __pyx_v_loc->sa_low; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":777 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":783 * veb = VEB(arr.len) * for i from loc.sa_low <= i < loc.sa_high: * veb._insert(arr.arr[i]) # <<<<<<<<<<<<<< @@ -44745,7 +47048,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_insert(__pyx_v_veb, (__pyx_v_arr->arr[__pyx_v_i])); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":778 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":784 * for i from loc.sa_low <= i < loc.sa_high: * veb._insert(arr.arr[i]) * i = veb.veb.min_val # <<<<<<<<<<<<<< @@ -44755,7 +47058,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str __pyx_t_5 = __pyx_v_veb->veb->min_val; __pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":779 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":785 * veb._insert(arr.arr[i]) * i = veb.veb.min_val * for j from 0 <= j < loc.sa_high-loc.sa_low: # <<<<<<<<<<<<<< @@ -44765,7 +47068,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str __pyx_t_5 = (__pyx_v_loc->sa_high - __pyx_v_loc->sa_low); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":780 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":786 * i = veb.veb.min_val * for j from 0 <= j < loc.sa_high-loc.sa_low: * loc.arr.arr[j] = i # <<<<<<<<<<<<<< @@ -44774,7 +47077,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str */ (__pyx_v_loc->arr->arr[__pyx_v_j]) = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":781 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":787 * for j from 0 <= j < loc.sa_high-loc.sa_low: * loc.arr.arr[j] = i * i = veb._findsucc(i) # <<<<<<<<<<<<<< @@ -44786,7 +47089,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":782 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":788 * loc.arr.arr[j] = i * i = veb._findsucc(i) * loc.arr_low = 0 # <<<<<<<<<<<<<< @@ -44795,7 +47098,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str */ __pyx_v_loc->arr_low = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":783 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":789 * i = veb._findsucc(i) * loc.arr_low = 0 * loc.arr_high = loc.arr.len # <<<<<<<<<<<<<< @@ -44805,17 +47108,26 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str __pyx_t_5 = __pyx_v_loc->arr->len; __pyx_v_loc->arr_high = __pyx_t_5; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":772 + * + * + * cdef void sort_phrase_loc(self, IntList arr, PhraseLocation loc, Phrase phrase): # <<<<<<<<<<<<<< + * cdef int i, j + * cdef VEB veb + */ + + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("cdec.sa._sa.HieroCachingRuleFactory.sort_phrase_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.HieroCachingRuleFactory.sort_phrase_loc", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_veb); __Pyx_RefNannyFinishContext(); } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":786 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":792 * * * cdef intersect_helper(self, Phrase prefix, Phrase suffix, # <<<<<<<<<<<<<< @@ -44852,7 +47164,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help int __pyx_clineno = 0; __Pyx_RefNannySetupContext("intersect_helper", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":793 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":799 * cdef int* result_ptr * * result_len = 0 # <<<<<<<<<<<<<< @@ -44861,21 +47173,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ __pyx_v_result_len = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":795 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":801 * result_len = 0 * * if sym_isvar(suffix[0]): # <<<<<<<<<<<<<< * offset_by_one = 1 * else: */ - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __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 = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_2) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":796 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":802 * * if sym_isvar(suffix[0]): * offset_by_one = 1 # <<<<<<<<<<<<<< @@ -44887,7 +47199,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":798 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":804 * offset_by_one = 1 * else: * offset_by_one = 0 # <<<<<<<<<<<<<< @@ -44898,34 +47210,34 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":800 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":806 * offset_by_one = 0 * * len_last = len(suffix.getchunk(suffix.arity())) # <<<<<<<<<<<<<< * * if prefix_loc.arr is None: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s_getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s_arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __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 = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __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 = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __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 = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __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; - __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__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 = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_len_last = __pyx_t_6; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":802 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":808 * len_last = len(suffix.getchunk(suffix.arity())) * * if prefix_loc.arr is None: # <<<<<<<<<<<<<< @@ -44936,7 +47248,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_7 = (__pyx_t_3 != 0); if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":803 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":809 * * if prefix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) # <<<<<<<<<<<<<< @@ -44951,7 +47263,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":804 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":810 * if prefix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) * arr1 = prefix_loc.arr # <<<<<<<<<<<<<< @@ -44963,7 +47275,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_v_arr1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":805 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":811 * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) * arr1 = prefix_loc.arr * low1 = prefix_loc.arr_low # <<<<<<<<<<<<<< @@ -44973,7 +47285,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_prefix_loc->arr_low; __pyx_v_low1 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":806 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":812 * arr1 = prefix_loc.arr * low1 = prefix_loc.arr_low * high1 = prefix_loc.arr_high # <<<<<<<<<<<<<< @@ -44983,7 +47295,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_prefix_loc->arr_high; __pyx_v_high1 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":807 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":813 * low1 = prefix_loc.arr_low * high1 = prefix_loc.arr_high * step1 = prefix_loc.num_subpatterns # <<<<<<<<<<<<<< @@ -44993,7 +47305,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_prefix_loc->num_subpatterns; __pyx_v_step1 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":809 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":815 * step1 = prefix_loc.num_subpatterns * * if suffix_loc.arr is None: # <<<<<<<<<<<<<< @@ -45004,7 +47316,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_3 = (__pyx_t_7 != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":810 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":816 * * if suffix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) # <<<<<<<<<<<<<< @@ -45019,7 +47331,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":811 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":817 * if suffix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) * arr2 = suffix_loc.arr # <<<<<<<<<<<<<< @@ -45031,7 +47343,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_v_arr2 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":812 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":818 * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) * arr2 = suffix_loc.arr * low2 = suffix_loc.arr_low # <<<<<<<<<<<<<< @@ -45041,7 +47353,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_suffix_loc->arr_low; __pyx_v_low2 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":813 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":819 * arr2 = suffix_loc.arr * low2 = suffix_loc.arr_low * high2 = suffix_loc.arr_high # <<<<<<<<<<<<<< @@ -45051,7 +47363,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_suffix_loc->arr_high; __pyx_v_high2 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":814 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":820 * low2 = suffix_loc.arr_low * high2 = suffix_loc.arr_high * step2 = suffix_loc.num_subpatterns # <<<<<<<<<<<<<< @@ -45061,26 +47373,26 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_2 = __pyx_v_suffix_loc->num_subpatterns; __pyx_v_step2 = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":816 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":822 * step2 = suffix_loc.num_subpatterns * * num_subpatterns = prefix.arity()+1 # <<<<<<<<<<<<<< * * if algorithm == MERGE: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_prefix), __pyx_n_s_arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 822; __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 = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 822; __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 = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_num_subpatterns = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":818 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":824 * num_subpatterns = prefix.arity()+1 * * if algorithm == MERGE: # <<<<<<<<<<<<<< @@ -45090,30 +47402,30 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_3 = ((__pyx_v_algorithm == __pyx_v_4cdec_2sa_3_sa_MERGE) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":821 - * result_ptr = self.merge_helper(low1, high1, arr1.arr, step1, + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":825 + * + * if algorithm == MERGE: + * result_ptr = self.merge_helper(low1, high1, arr1.arr, step1, # <<<<<<<<<<<<<< * low2, high2, arr2.arr, step2, - * offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<< - * else: - * result_ptr = self.baeza_yates_helper(low1, high1, arr1.arr, step1, + * offset_by_one, len_last, num_subpatterns, &result_len) */ __pyx_v_result_ptr = ((struct __pyx_vtabstruct_4cdec_2sa_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*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":825 - * result_ptr = self.baeza_yates_helper(low1, high1, arr1.arr, step1, + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":829 + * offset_by_one, len_last, num_subpatterns, &result_len) + * else: + * result_ptr = self.baeza_yates_helper(low1, high1, arr1.arr, step1, # <<<<<<<<<<<<<< * low2, high2, arr2.arr, step2, - * offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<< - * - * if result_len == 0: + * offset_by_one, len_last, num_subpatterns, &result_len) */ __pyx_v_result_ptr = ((struct __pyx_vtabstruct_4cdec_2sa_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:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":827 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":833 * offset_by_one, len_last, num_subpatterns, &result_len) * * if result_len == 0: # <<<<<<<<<<<<<< @@ -45123,7 +47435,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __pyx_t_3 = ((__pyx_v_result_len == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":828 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":834 * * if result_len == 0: * free(result_ptr) # <<<<<<<<<<<<<< @@ -45132,7 +47444,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ free(__pyx_v_result_ptr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":829 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":835 * if result_len == 0: * free(result_ptr) * return None # <<<<<<<<<<<<<< @@ -45143,23 +47455,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; - goto __pyx_L7; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":831 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":837 * return None * else: * result = IntList() # <<<<<<<<<<<<<< * free(result.arr) * result.arr = result_ptr */ - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_v_result = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":832 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":838 * else: * result = IntList() * free(result.arr) # <<<<<<<<<<<<<< @@ -45168,7 +47479,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ free(__pyx_v_result->arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":833 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":839 * result = IntList() * free(result.arr) * result.arr = result_ptr # <<<<<<<<<<<<<< @@ -45177,7 +47488,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ __pyx_v_result->arr = __pyx_v_result_ptr; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":834 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":840 * free(result.arr) * result.arr = result_ptr * result.len = result_len # <<<<<<<<<<<<<< @@ -45186,7 +47497,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ __pyx_v_result->len = __pyx_v_result_len; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":835 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":841 * result.arr = result_ptr * result.len = result_len * result.size = result_len # <<<<<<<<<<<<<< @@ -45195,7 +47506,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help */ __pyx_v_result->size = __pyx_v_result_len; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":836 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":842 * result.len = result_len * result.size = result_len * return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) # <<<<<<<<<<<<<< @@ -45203,29 +47514,35 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help * cdef loc2str(self, PhraseLocation loc): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __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 = 836; __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 = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arr_low, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_result_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __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 = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arr_high, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __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 = 836; __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 = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arr, ((PyObject *)__pyx_v_result)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __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 = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_num_subpatterns, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __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_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } - __pyx_L7:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":792 + * + * + * cdef intersect_helper(self, Phrase prefix, Phrase suffix, # <<<<<<<<<<<<<< + * PhraseLocation prefix_loc, PhraseLocation suffix_loc, int algorithm): + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); @@ -45241,7 +47558,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":838 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":844 * return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) * * cdef loc2str(self, PhraseLocation loc): # <<<<<<<<<<<<<< @@ -45264,17 +47581,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON int __pyx_clineno = 0; __Pyx_RefNannySetupContext("loc2str", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":840 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":846 * cdef loc2str(self, PhraseLocation loc): * cdef int i, j * result = "{" # <<<<<<<<<<<<<< * i = 0 * while i < loc.arr_high: */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_120)); - __pyx_v_result = ((PyObject *)__pyx_kp_s_120); + __Pyx_INCREF(__pyx_kp_s__63); + __pyx_v_result = __pyx_kp_s__63; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":841 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":847 * cdef int i, j * result = "{" * i = 0 # <<<<<<<<<<<<<< @@ -45283,7 +47600,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON */ __pyx_v_i = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":842 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":848 * result = "{" * i = 0 * while i < loc.arr_high: # <<<<<<<<<<<<<< @@ -45294,19 +47611,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON __pyx_t_1 = ((__pyx_v_i < __pyx_v_loc->arr_high) != 0); if (!__pyx_t_1) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":843 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":849 * i = 0 * while i < loc.arr_high: * result = result + "(" # <<<<<<<<<<<<<< * for j from i <= j < i + loc.num_subpatterns: * result = result + ("%d " %loc.arr[j]) */ - __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_121)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":844 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":850 * while i < loc.arr_high: * result = result + "(" * for j from i <= j < i + loc.num_subpatterns: # <<<<<<<<<<<<<< @@ -45316,38 +47633,38 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON __pyx_t_3 = (__pyx_v_i + __pyx_v_loc->num_subpatterns); for (__pyx_v_j = __pyx_v_i; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":845 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":851 * result = result + "(" * for j from i <= j < i + loc.num_subpatterns: * result = result + ("%d " %loc.arr[j]) # <<<<<<<<<<<<<< * result = result + ")" * i = i + loc.num_subpatterns */ - __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_loc->arr), __pyx_v_j, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_loc->arr), __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 851; __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_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":846 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":852 * for j from i <= j < i + loc.num_subpatterns: * result = result + ("%d " %loc.arr[j]) * result = result + ")" # <<<<<<<<<<<<<< * i = i + loc.num_subpatterns * result = result + "}" */ - __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__42); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":847 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":853 * result = result + ("%d " %loc.arr[j]) * result = result + ")" * i = i + loc.num_subpatterns # <<<<<<<<<<<<<< @@ -45357,19 +47674,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON __pyx_v_i = (__pyx_v_i + __pyx_v_loc->num_subpatterns); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":848 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":854 * result = result + ")" * i = i + loc.num_subpatterns * result = result + "}" # <<<<<<<<<<<<<< * return result * */ - __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_122)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__65); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":849 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":855 * i = i + loc.num_subpatterns * result = result + "}" * return result # <<<<<<<<<<<<<< @@ -45381,8 +47698,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":844 + * return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) + * + * cdef loc2str(self, PhraseLocation loc): # <<<<<<<<<<<<<< + * cdef int i, j + * result = "{" + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); @@ -45395,7 +47719,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":851 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":857 * return result * * cdef PhraseLocation intersect(self, prefix_node, suffix_node, Phrase phrase): # <<<<<<<<<<<<<< @@ -45422,81 +47746,81 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("intersect", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":855 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":861 * cdef PhraseLocation prefix_loc, suffix_loc, result * * prefix = prefix_node.phrase # <<<<<<<<<<<<<< * suffix = suffix_node.phrase * prefix_loc = prefix_node.phrase_location */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s_phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __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_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_prefix = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":856 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":862 * * prefix = prefix_node.phrase * suffix = suffix_node.phrase # <<<<<<<<<<<<<< * prefix_loc = prefix_node.phrase_location * suffix_loc = suffix_node.phrase_location */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s_phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __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_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_suffix = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":857 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":863 * prefix = prefix_node.phrase * suffix = suffix_node.phrase * prefix_loc = prefix_node.phrase_location # <<<<<<<<<<<<<< * suffix_loc = suffix_node.phrase_location * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s_phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_prefix_loc = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":858 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":864 * suffix = suffix_node.phrase * prefix_loc = prefix_node.phrase_location * suffix_loc = suffix_node.phrase_location # <<<<<<<<<<<<<< * * result = self.get_precomputed_collocation(phrase) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s_phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 864; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_suffix_loc = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":860 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":866 * suffix_loc = suffix_node.phrase_location * * result = self.get_precomputed_collocation(phrase) # <<<<<<<<<<<<<< * if result is not None: * intersect_method = "precomputed" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_precomputed_collocation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __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 = 860; __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 = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_phrase)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_phrase)); __Pyx_GIVEREF(((PyObject *)__pyx_v_phrase)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __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; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_result = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":861 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":867 * * result = self.get_precomputed_collocation(phrase) * if result is not None: # <<<<<<<<<<<<<< @@ -45507,20 +47831,20 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":862 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":868 * result = self.get_precomputed_collocation(phrase) * if result is not None: * intersect_method = "precomputed" # <<<<<<<<<<<<<< * * if result is None: */ - __Pyx_INCREF(((PyObject *)__pyx_n_s__precomputed)); - __pyx_v_intersect_method = ((PyObject *)__pyx_n_s__precomputed); + __Pyx_INCREF(__pyx_n_s_precomputed); + __pyx_v_intersect_method = __pyx_n_s_precomputed; goto __pyx_L3; } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":864 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":870 * intersect_method = "precomputed" * * if result is None: # <<<<<<<<<<<<<< @@ -45531,7 +47855,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":865 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":871 * * if result is None: * if self.use_baeza_yates: # <<<<<<<<<<<<<< @@ -45541,61 +47865,61 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 __pyx_t_4 = (__pyx_v_self->use_baeza_yates != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":866 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":872 * if result is None: * if self.use_baeza_yates: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES) # <<<<<<<<<<<<<< * intersect_method="double binary" * else: */ - __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_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_4cdec_2sa_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_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_4cdec_2sa_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_result, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":867 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":873 * if self.use_baeza_yates: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES) * intersect_method="double binary" # <<<<<<<<<<<<<< * else: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_124)); - __Pyx_XDECREF_SET(__pyx_v_intersect_method, ((PyObject *)__pyx_kp_s_124)); + __Pyx_INCREF(__pyx_kp_s_double_binary); + __Pyx_XDECREF_SET(__pyx_v_intersect_method, __pyx_kp_s_double_binary); goto __pyx_L5; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":869 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":875 * intersect_method="double binary" * else: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) # <<<<<<<<<<<<<< * intersect_method="merge" * return result */ - __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_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_4cdec_2sa_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_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_4cdec_2sa_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 875; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_result, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":870 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":876 * else: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) * intersect_method="merge" # <<<<<<<<<<<<<< * return result * */ - __Pyx_INCREF(((PyObject *)__pyx_n_s__merge)); - __Pyx_XDECREF_SET(__pyx_v_intersect_method, ((PyObject *)__pyx_n_s__merge)); + __Pyx_INCREF(__pyx_n_s_merge); + __Pyx_XDECREF_SET(__pyx_v_intersect_method, __pyx_n_s_merge); } __pyx_L5:; goto __pyx_L4; } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":871 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":877 * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) * intersect_method="merge" * return result # <<<<<<<<<<<<<< @@ -45607,8 +47931,15 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)Py_None); __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":857 + * return result + * + * cdef PhraseLocation intersect(self, prefix_node, suffix_node, Phrase phrase): # <<<<<<<<<<<<<< + * cdef Phrase prefix, suffix + * cdef PhraseLocation prefix_loc, suffix_loc, result + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -45627,6 +47958,14 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23 return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":879 + * return result + * + * def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<< + * cdef unsigned na + * nf = [] + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -45640,7 +47979,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("advance (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__frontier,&__pyx_n_s__res,&__pyx_n_s__fwords,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; @@ -45655,21 +47994,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyO kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frontier)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__res)) != 0)) 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 = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) 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 = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "advance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "advance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -45684,25 +48023,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_frontier, __pyx_v_res, __pyx_v_fwords); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":873 - * return result - * - * def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<< - * cdef unsigned na - * nf = [] - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_obj_4cdec_2sa_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; @@ -45726,29 +48059,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; - Py_ssize_t __pyx_t_13; - int __pyx_t_14; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; int __pyx_t_15; - unsigned int __pyx_t_16; - int __pyx_t_17; + int __pyx_t_16; + unsigned int __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("advance", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":875 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":881 * def advance(self, frontier, res, fwords): * cdef unsigned na * nf = [] # <<<<<<<<<<<<<< * for toskip, (i, alt, pathlen) in frontier: * spanlen = fwords[i][alt][2] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 875; __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 = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_nf = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":876 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":882 * cdef unsigned na * nf = [] * for toskip, (i, alt, pathlen) in frontier: # <<<<<<<<<<<<<< @@ -45759,7 +48092,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __pyx_t_1 = __pyx_v_frontier; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_frontier); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_frontier); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -45767,23 +48100,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -45799,7 +48133,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -45812,16 +48146,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __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 = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -45829,7 +48162,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __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[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __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; @@ -45837,7 +48170,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_toskip, __pyx_t_5); @@ -45852,7 +48185,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -45868,18 +48201,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __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 = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __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 = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); #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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext; @@ -45889,7 +48221,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_GOTREF(__pyx_t_9); 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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __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; @@ -45897,7 +48229,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7); @@ -45907,44 +48239,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_XDECREF_SET(__pyx_v_pathlen, __pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":877 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":883 * nf = [] * for toskip, (i, alt, pathlen) in frontier: * spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<< * if toskip == 0: * res.append((i, alt, pathlen)) */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_i); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_spanlen, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":878 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":884 * for toskip, (i, alt, pathlen) in frontier: * spanlen = fwords[i][alt][2] * if toskip == 0: # <<<<<<<<<<<<<< * res.append((i, alt, pathlen)) * ni = i + spanlen */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_toskip, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_toskip, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":879 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":885 * spanlen = fwords[i][alt][2] * if toskip == 0: * res.append((i, alt, pathlen)) # <<<<<<<<<<<<<< * ni = i + spanlen * if ni < len(fwords) and pathlen + 1 < self.max_initial_size: */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_i); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_i); @@ -45955,104 +48287,102 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __Pyx_INCREF(__pyx_v_pathlen); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_pathlen); __Pyx_GIVEREF(__pyx_v_pathlen); - __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_res, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_res, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L9; } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":880 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":886 * if toskip == 0: * res.append((i, alt, pathlen)) * ni = i + spanlen # <<<<<<<<<<<<<< * if ni < len(fwords) and pathlen + 1 < self.max_initial_size: * for na in range(len(fwords[ni])): */ - __pyx_t_6 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_v_ni, __pyx_t_6); - __pyx_t_6 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_ni, __pyx_t_4); + __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":881 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":887 * res.append((i, alt, pathlen)) * ni = i + spanlen * if ni < len(fwords) and pathlen + 1 < self.max_initial_size: # <<<<<<<<<<<<<< * for na in range(len(fwords[ni])): * nf.append((toskip - 1, (ni, na, pathlen + 1))) */ - __pyx_t_13 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_ni, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_v_ni, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_12) { - __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_15 = __pyx_t_14; + __pyx_t_16 = __pyx_t_15; } else { - __pyx_t_15 = __pyx_t_12; + __pyx_t_16 = __pyx_t_12; } - if (__pyx_t_15) { + if (__pyx_t_16) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":882 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":888 * ni = i + spanlen * if ni < len(fwords) and pathlen + 1 < self.max_initial_size: * for na in range(len(fwords[ni])): # <<<<<<<<<<<<<< * nf.append((toskip - 1, (ni, na, pathlen + 1))) * if len(nf) > 0: */ - __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ni); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ni); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); - __pyx_t_13 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_13; __pyx_t_16+=1) { - __pyx_v_na = __pyx_t_16; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_14; __pyx_t_17+=1) { + __pyx_v_na = __pyx_t_17; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":883 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":889 * if ni < len(fwords) and pathlen + 1 < self.max_initial_size: * for na in range(len(fwords[ni])): * nf.append((toskip - 1, (ni, na, pathlen + 1))) # <<<<<<<<<<<<<< * if len(nf) > 0: * return self.advance(nf, res, fwords) */ - __pyx_t_5 = PyNumber_Subtract(__pyx_v_toskip, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_toskip, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_na); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_na); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_ni); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_ni); __Pyx_GIVEREF(__pyx_v_ni); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_6 = 0; + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __pyx_t_5 = 0; __pyx_t_10 = 0; - __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_nf, __pyx_t_6); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } goto __pyx_L10; } @@ -46060,18 +48390,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":884 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":890 * for na in range(len(fwords[ni])): * nf.append((toskip - 1, (ni, na, pathlen + 1))) * if len(nf) > 0: # <<<<<<<<<<<<<< * return self.advance(nf, res, fwords) * else: */ - __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_15 = ((__pyx_t_2 > 0) != 0); - if (__pyx_t_15) { + __pyx_t_2 = PyList_GET_SIZE(__pyx_v_nf); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((__pyx_t_2 > 0) != 0); + if (__pyx_t_16) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":885 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":891 * nf.append((toskip - 1, (ni, na, pathlen + 1))) * if len(nf) > 0: * return self.advance(nf, res, fwords) # <<<<<<<<<<<<<< @@ -46079,31 +48409,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str * return res */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_v_nf)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_nf)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_nf)); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_nf); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_nf); + __Pyx_GIVEREF(__pyx_v_nf); __Pyx_INCREF(__pyx_v_res); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_res); __Pyx_GIVEREF(__pyx_v_res); __Pyx_INCREF(__pyx_v_fwords); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_fwords); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_fwords); __Pyx_GIVEREF(__pyx_v_fwords); - __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __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_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - goto __pyx_L13; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":887 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":893 * return self.advance(nf, res, fwords) * else: * return res # <<<<<<<<<<<<<< @@ -46115,10 +48444,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str __pyx_r = __pyx_v_res; goto __pyx_L0; } - __pyx_L13:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":879 + * return result + * + * def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<< + * cdef unsigned na + * nf = [] + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); @@ -46143,6 +48478,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":895 + * return res + * + * def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<< + * cdef unsigned alt_it + * frontier = [] + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_away(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_away(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -46160,7 +48503,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nod __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}; + 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; @@ -46179,41 +48522,41 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nod kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__skip)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) 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 = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__spanlen)) != 0)) 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 = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pathlen)) != 0)) 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 = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) 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 = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__next_states)) != 0)) 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 = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reachable_buffer)) != 0)) 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 = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_nodes_isteps_away") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_nodes_isteps_away") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -46236,25 +48579,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nod } goto __pyx_L4_argument_unpacking_done; __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 = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._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_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_away(((struct __pyx_obj_4cdec_2sa_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); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":889 - * return res - * - * def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<< - * cdef unsigned alt_it - * frontier = [] - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_away(struct __pyx_obj_4cdec_2sa_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; @@ -46262,7 +48599,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod PyObject *__pyx_v_nextreachable = NULL; PyObject *__pyx_v_next_id = NULL; PyObject *__pyx_v_jump = NULL; - PyObject *__pyx_v_alt_id = NULL; + Py_ssize_t __pyx_v_alt_id; PyObject *__pyx_v_newel = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -46278,49 +48615,48 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); - PyObject *__pyx_t_14 = NULL; - int __pyx_t_15; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_all_nodes_isteps_away", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":891 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":897 * def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): * cdef unsigned alt_it * frontier = [] # <<<<<<<<<<<<<< * if i+spanlen+skip >= len(next_states): * return frontier */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __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 = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_frontier = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":892 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":898 * cdef unsigned alt_it * frontier = [] * if i+spanlen+skip >= len(next_states): # <<<<<<<<<<<<<< * return frontier * key = tuple([i,spanlen]) */ - __pyx_t_1 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = PyObject_Length(__pyx_v_next_states); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_v_next_states); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":893 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":899 * frontier = [] * if i+spanlen+skip >= len(next_states): * return frontier # <<<<<<<<<<<<<< @@ -46328,21 +48664,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod * reachable = [] */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_frontier)); - __pyx_r = ((PyObject *)__pyx_v_frontier); + __Pyx_INCREF(__pyx_v_frontier); + __pyx_r = __pyx_v_frontier; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":894 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":900 * if i+spanlen+skip >= len(next_states): * return frontier * key = tuple([i,spanlen]) # <<<<<<<<<<<<<< * reachable = [] * if key in reachable_buffer: */ - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_i); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_i); @@ -46350,43 +48684,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_INCREF(__pyx_v_spanlen); PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_spanlen); __Pyx_GIVEREF(__pyx_v_spanlen); - __pyx_t_1 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_4))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_1 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_key = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":895 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":901 * return frontier * key = tuple([i,spanlen]) * reachable = [] # <<<<<<<<<<<<<< * if key in reachable_buffer: * reachable = reachable_buffer[key] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __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 = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_reachable = ((PyObject *)__pyx_t_1); + __pyx_v_reachable = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":896 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":902 * key = tuple([i,spanlen]) * reachable = [] * if key in reachable_buffer: # <<<<<<<<<<<<<< * reachable = reachable_buffer[key] * else: */ - __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_key), __pyx_v_reachable_buffer, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_reachable_buffer, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":897 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":903 * reachable = [] * if key in reachable_buffer: * reachable = reachable_buffer[key] # <<<<<<<<<<<<<< * else: * reachable = self.reachable(fwords, i, spanlen) */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_reachable_buffer, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_reachable, __pyx_t_1); __pyx_t_1 = 0; @@ -46394,16 +48728,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":899 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":905 * reachable = reachable_buffer[key] * else: * reachable = self.reachable(fwords, i, spanlen) # <<<<<<<<<<<<<< * reachable_buffer[key] = reachable * for nextreachable in reachable: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reachable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fwords); @@ -46414,25 +48748,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_INCREF(__pyx_v_spanlen); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_spanlen); __Pyx_GIVEREF(__pyx_v_spanlen); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __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_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_reachable, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":900 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":906 * else: * reachable = self.reachable(fwords, i, spanlen) * reachable_buffer[key] = reachable # <<<<<<<<<<<<<< * for nextreachable in reachable: * for next_id in next_states[nextreachable]: */ - if (PyObject_SetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key), __pyx_v_reachable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyObject_SetItem(__pyx_v_reachable_buffer, __pyx_v_key, __pyx_v_reachable) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":901 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":907 * reachable = self.reachable(fwords, i, spanlen) * reachable_buffer[key] = reachable * for nextreachable in reachable: # <<<<<<<<<<<<<< @@ -46443,7 +48777,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __pyx_t_2 = __pyx_v_reachable; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_reachable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_reachable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -46451,23 +48785,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod if (!__pyx_t_7 && 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_7 && 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -46476,20 +48811,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_XDECREF_SET(__pyx_v_nextreachable, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":902 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":908 * reachable_buffer[key] = reachable * for nextreachable in reachable: * for next_id in next_states[nextreachable]: # <<<<<<<<<<<<<< * jump = self.shortest(fwords,i,next_id) * if jump < skip: */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_next_states, __pyx_v_nextreachable); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_next_states, __pyx_v_nextreachable); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -46498,23 +48833,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod 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_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_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_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -46523,16 +48859,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_XDECREF_SET(__pyx_v_next_id, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":903 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":909 * for nextreachable in reachable: * for next_id in next_states[nextreachable]: * jump = self.shortest(fwords,i,next_id) # <<<<<<<<<<<<<< * if jump < skip: * continue */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_fwords); @@ -46543,26 +48879,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_INCREF(__pyx_v_next_id); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_next_id); __Pyx_GIVEREF(__pyx_v_next_id); - __pyx_t_11 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_jump, __pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":904 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":910 * for next_id in next_states[nextreachable]: * jump = self.shortest(fwords,i,next_id) * if jump < skip: # <<<<<<<<<<<<<< * continue * if pathlen+jump <= self.max_initial_size: */ - __pyx_t_11 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":905 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":911 * jump = self.shortest(fwords,i,next_id) * if jump < skip: * continue # <<<<<<<<<<<<<< @@ -46570,167 +48906,124 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod * for alt_id in range(len(fwords[next_id])): */ goto __pyx_L7_continue; - goto __pyx_L9; } - __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":906 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":912 * if jump < skip: * continue * if pathlen+jump <= self.max_initial_size: # <<<<<<<<<<<<<< * for alt_id in range(len(fwords[next_id])): * if fwords[next_id][alt_id][0] != EPSILON: */ - __pyx_t_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":907 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":913 * continue * if pathlen+jump <= self.max_initial_size: * for alt_id in range(len(fwords[next_id])): # <<<<<<<<<<<<<< * if fwords[next_id][alt_id][0] != EPSILON: * newel = (next_id,alt_id,pathlen+jump) */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_10 = __pyx_t_4; __Pyx_INCREF(__pyx_t_10); __pyx_t_12 = 0; - __pyx_t_13 = NULL; - } else { - __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext; - } + __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_10)) { - if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_10)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_10)) { - if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_10)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_4 = __pyx_t_13(__pyx_t_10); - if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_alt_id, __pyx_t_4); - __pyx_t_4 = 0; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_alt_id = __pyx_t_13; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":908 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":914 * if pathlen+jump <= self.max_initial_size: * for alt_id in range(len(fwords[next_id])): * if fwords[next_id][alt_id][0] != EPSILON: # <<<<<<<<<<<<<< * newel = (next_id,alt_id,pathlen+jump) * if newel not in frontier: */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_alt_id, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_11, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_14 = PyObject_RichCompare(__pyx_t_4, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":909 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":915 * for alt_id in range(len(fwords[next_id])): * if fwords[next_id][alt_id][0] != EPSILON: * newel = (next_id,alt_id,pathlen+jump) # <<<<<<<<<<<<<< * if newel not in frontier: * frontier.append((next_id,alt_id,pathlen+jump)) */ - __pyx_t_14 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_alt_id); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_next_id); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_next_id); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_next_id); __Pyx_GIVEREF(__pyx_v_next_id); - __Pyx_INCREF(__pyx_v_alt_id); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_alt_id); - __Pyx_GIVEREF(__pyx_v_alt_id); - PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_14); - __Pyx_GIVEREF(__pyx_t_14); - __pyx_t_14 = 0; - __Pyx_XDECREF_SET(__pyx_v_newel, ((PyObject*)__pyx_t_11)); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __pyx_t_11 = 0; + __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_newel, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":910 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":916 * if fwords[next_id][alt_id][0] != EPSILON: * newel = (next_id,alt_id,pathlen+jump) * if newel not in frontier: # <<<<<<<<<<<<<< * frontier.append((next_id,alt_id,pathlen+jump)) * return frontier */ - __pyx_t_6 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__Pyx_PySequence_Contains(__pyx_v_newel, __pyx_v_frontier, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":911 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":917 * newel = (next_id,alt_id,pathlen+jump) * if newel not in frontier: * frontier.append((next_id,alt_id,pathlen+jump)) # <<<<<<<<<<<<<< * return frontier * */ - __pyx_t_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_alt_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_next_id); - PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_next_id); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_next_id); __Pyx_GIVEREF(__pyx_v_next_id); - __Pyx_INCREF(__pyx_v_alt_id); - PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_alt_id); - __Pyx_GIVEREF(__pyx_v_alt_id); - PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_4 = 0; + __pyx_t_10 = 0; + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_frontier, __pyx_t_11); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L14; } __pyx_L14:; @@ -46738,7 +49031,6 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod } __pyx_L13:; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L10; } __pyx_L10:; @@ -46748,7 +49040,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":912 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":918 * if newel not in frontier: * frontier.append((next_id,alt_id,pathlen+jump)) * return frontier # <<<<<<<<<<<<<< @@ -46756,19 +49048,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod * def reachable(self, fwords, ifrom, dist): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_frontier)); - __pyx_r = ((PyObject *)__pyx_v_frontier); + __Pyx_INCREF(__pyx_v_frontier); + __pyx_r = __pyx_v_frontier; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":895 + * return res + * + * def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<< + * cdef unsigned alt_it + * frontier = [] + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_all_nodes_isteps_away", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -46778,13 +49076,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod __Pyx_XDECREF(__pyx_v_nextreachable); __Pyx_XDECREF(__pyx_v_next_id); __Pyx_XDECREF(__pyx_v_jump); - __Pyx_XDECREF(__pyx_v_alt_id); __Pyx_XDECREF(__pyx_v_newel); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":920 + * return frontier + * + * def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<< + * ret = [] + * if ifrom >= len(fwords): + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -46798,7 +49103,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(P __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reachable (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__dist,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; @@ -46813,21 +49118,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(P kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom)) != 0)) 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 = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist)) != 0)) 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 = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reachable") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reachable") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -46842,28 +49147,22 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fwords, __pyx_v_ifrom, __pyx_v_dist); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":914 - * return frontier - * - * def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<< - * ret = [] - * if ifrom >= len(fwords): - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(struct __pyx_obj_4cdec_2sa_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; + Py_ssize_t __pyx_v_alt_id; PyObject *__pyx_v_ifromchild = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -46871,48 +49170,47 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - int __pyx_t_10; - Py_ssize_t __pyx_t_11; - PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reachable", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":915 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":921 * * def reachable(self, fwords, ifrom, dist): * ret = [] # <<<<<<<<<<<<<< * if ifrom >= len(fwords): * return ret */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __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 = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":916 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":922 * def reachable(self, fwords, ifrom, dist): * ret = [] * if ifrom >= len(fwords): # <<<<<<<<<<<<<< * return ret * for alt_id in range(len(fwords[ifrom])): */ - __pyx_t_2 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __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[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __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[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":917 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":923 * ret = [] * if ifrom >= len(fwords): * return ret # <<<<<<<<<<<<<< @@ -46920,178 +49218,121 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s * if fwords[ifrom][alt_id][0] == EPSILON: */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_ret)); - __pyx_r = ((PyObject *)__pyx_v_ret); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":918 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":924 * if ifrom >= len(fwords): * return ret * for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<< * if fwords[ifrom][alt_id][0] == EPSILON: * ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__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_2 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; - } + __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #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 = 918; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #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 = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_alt_id, __pyx_t_3); - __pyx_t_3 = 0; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { + __pyx_v_alt_id = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":919 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":925 * return ret * for alt_id in range(len(fwords[ifrom])): * if fwords[ifrom][alt_id][0] == EPSILON: # <<<<<<<<<<<<<< * ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) * else: */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_alt_id, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __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_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __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); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":920 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":926 * for alt_id in range(len(fwords[ifrom])): * if fwords[ifrom][alt_id][0] == EPSILON: * ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) # <<<<<<<<<<<<<< * else: * if dist == 0: */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __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_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_alt_id, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __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(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_fwords); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fwords); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fwords); __Pyx_GIVEREF(__pyx_v_fwords); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_dist); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_dist); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_dist); __Pyx_GIVEREF(__pyx_v_dist); - __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __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_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __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_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_ret, __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L6; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":922 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":928 * ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) * else: * if dist == 0: # <<<<<<<<<<<<<< * if ifrom not in ret: * ret.append(ifrom) */ - __pyx_t_8 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":923 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":929 * else: * if dist == 0: * if ifrom not in ret: # <<<<<<<<<<<<<< * ret.append(ifrom) * else: */ - __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifrom, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = (__pyx_t_4 != 0); - if (__pyx_t_9) { + __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifrom, __pyx_v_ret, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = (__pyx_t_4 != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":924 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":930 * if dist == 0: * if ifrom not in ret: * ret.append(ifrom) # <<<<<<<<<<<<<< * else: * for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): */ - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; @@ -47099,113 +49340,113 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":926 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":932 * ret.append(ifrom) * else: * for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): # <<<<<<<<<<<<<< * if ifromchild not in ret: * ret.append(ifromchild) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __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_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_v_dist, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reachable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_alt_id, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_6, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_dist, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_fwords); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_fwords); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_fwords); __Pyx_GIVEREF(__pyx_v_fwords); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_7 = 0; - __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[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = 0; - __pyx_t_12 = NULL; + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_6 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __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_9); __pyx_t_9 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0; + __pyx_t_11 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; + __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_6)) { - if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_6)) break; + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_6)) { - if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_3 = __pyx_t_12(__pyx_t_6); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_t_11(__pyx_t_9); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_v_ifromchild, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_ifromchild, __pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":927 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":933 * else: * for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): * if ifromchild not in ret: # <<<<<<<<<<<<<< * ret.append(ifromchild) * */ - __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = (__pyx_t_9 != 0); + __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, __pyx_v_ret, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (__pyx_t_8 != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":928 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":934 * for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): * if ifromchild not in ret: * ret.append(ifromchild) # <<<<<<<<<<<<<< * * return ret */ - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L11; } __pyx_L11:; } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_L7:; } __pyx_L6:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":930 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":936 * ret.append(ifromchild) * * return ret # <<<<<<<<<<<<<< @@ -47213,29 +49454,42 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s * def shortest(self, fwords, ifrom, ito): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_ret)); - __pyx_r = ((PyObject *)__pyx_v_ret); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":920 + * return frontier + * + * def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<< + * ret = [] + * if ifrom >= len(fwords): + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XDECREF(__pyx_v_alt_id); __Pyx_XDECREF(__pyx_v_ifromchild); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":938 + * return ret + * + * def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<< + * cdef unsigned alt_id + * min = 1000 + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -47249,7 +49503,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("shortest (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__ito,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; @@ -47264,21 +49518,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(Py kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom)) != 0)) 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 = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ito)) != 0)) 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 = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortest") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortest") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -47293,25 +49547,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.shortest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fwords, __pyx_v_ifrom, __pyx_v_ito); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":932 - * return ret - * - * def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<< - * cdef unsigned alt_id - * min = 1000 - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx_obj_4cdec_2sa_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; @@ -47329,7 +49577,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shortest", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":934 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":940 * def shortest(self, fwords, ifrom, ito): * cdef unsigned alt_id * min = 1000 # <<<<<<<<<<<<<< @@ -47339,19 +49587,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st __Pyx_INCREF(__pyx_int_1000); __pyx_v_min = __pyx_int_1000; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":935 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":941 * cdef unsigned alt_id * min = 1000 * if ifrom > ito: # <<<<<<<<<<<<<< * return min * if ifrom == ito: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 935; __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[8]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __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[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":936 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":942 * min = 1000 * if ifrom > ito: * return min # <<<<<<<<<<<<<< @@ -47362,23 +49610,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st __Pyx_INCREF(__pyx_v_min); __pyx_r = __pyx_v_min; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":937 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":943 * if ifrom > ito: * return min * if ifrom == ito: # <<<<<<<<<<<<<< * return 0 * for alt_id in range(len(fwords[ifrom])): */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __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[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __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[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":938 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":944 * return min * if ifrom == ito: * return 0 # <<<<<<<<<<<<<< @@ -47389,45 +49635,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":939 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":945 * if ifrom == ito: * return 0 * for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<< * currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) * if fwords[ifrom][alt_id][0] != EPSILON: */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_alt_id = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":940 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":946 * return 0 * for alt_id in range(len(fwords[ifrom])): * currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) # <<<<<<<<<<<<<< * if fwords[ifrom][alt_id][0] != EPSILON: * currmin += 1 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_alt_id, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fwords); @@ -47438,45 +49682,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_ito); __Pyx_GIVEREF(__pyx_v_ito); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __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; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_currmin, __pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":941 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":947 * for alt_id in range(len(fwords[ifrom])): * currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) * if fwords[ifrom][alt_id][0] != EPSILON: # <<<<<<<<<<<<<< * currmin += 1 * if currmin < min: */ - __pyx_t_6 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_alt_id, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __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_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __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); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __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[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":942 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":948 * currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) * if fwords[ifrom][alt_id][0] != EPSILON: * currmin += 1 # <<<<<<<<<<<<<< * if currmin < min: * min = currmin */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_currmin, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_currmin, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_currmin, __pyx_t_1); __pyx_t_1 = 0; @@ -47484,19 +49728,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":943 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":949 * if fwords[ifrom][alt_id][0] != EPSILON: * currmin += 1 * if currmin < min: # <<<<<<<<<<<<<< * min = currmin * return min */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_currmin, __pyx_v_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __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[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_currmin, __pyx_v_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 949; __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[8]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":944 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":950 * currmin += 1 * if currmin < min: * min = currmin # <<<<<<<<<<<<<< @@ -47510,7 +49754,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st __pyx_L8:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":945 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":951 * if currmin < min: * min = currmin * return min # <<<<<<<<<<<<<< @@ -47522,8 +49766,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st __pyx_r = __pyx_v_min; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":938 + * return ret + * + * def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<< + * cdef unsigned alt_id + * min = 1000 + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); @@ -47538,6 +49789,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":953 + * return min + * + * def get_next_states(self, _columns, curr_idx, min_dist=2): # <<<<<<<<<<<<<< + * result = [] + * candidate = [[curr_idx,0]] + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -47551,7 +49810,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st __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}; + 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)) { @@ -47567,21 +49826,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s___columns)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__curr_idx)) != 0)) 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 = 947; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_dist); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_dist); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_next_states") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_next_states") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -47598,25 +49857,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_next_states", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_states(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v__columns, __pyx_v_curr_idx, __pyx_v_min_dist); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":947 - * return min - * - * def get_next_states(self, _columns, curr_idx, min_dist=2): # <<<<<<<<<<<<<< - * result = [] - * candidate = [[curr_idx,0]] - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_states(struct __pyx_obj_4cdec_2sa_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; @@ -47642,26 +49895,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_next_states", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":948 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":954 * * def get_next_states(self, _columns, curr_idx, min_dist=2): * result = [] # <<<<<<<<<<<<<< * candidate = [[curr_idx,0]] * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __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 = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":949 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":955 * def get_next_states(self, _columns, curr_idx, min_dist=2): * result = [] * candidate = [[curr_idx,0]] # <<<<<<<<<<<<<< * * while len(candidate) > 0: */ - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_curr_idx); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_curr_idx); @@ -47669,15 +49922,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __Pyx_INCREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_candidate = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":951 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":957 * candidate = [[curr_idx,0]] * * while len(candidate) > 0: # <<<<<<<<<<<<<< @@ -47685,42 +49938,42 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st * if curr[0] >= len(_columns): */ while (1) { - __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_SIZE(__pyx_v_candidate); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((__pyx_t_3 > 0) != 0); if (!__pyx_t_4) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":952 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":958 * * while len(candidate) > 0: * curr = candidate.pop() # <<<<<<<<<<<<<< * if curr[0] >= len(_columns): * continue */ - __pyx_t_2 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_candidate)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_candidate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_curr, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":953 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":959 * while len(candidate) > 0: * curr = candidate.pop() * if curr[0] >= len(_columns): # <<<<<<<<<<<<<< * continue * if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_v__columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_v__columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __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 = 953; __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 = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":954 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":960 * curr = candidate.pop() * if curr[0] >= len(_columns): * continue # <<<<<<<<<<<<<< @@ -47728,34 +49981,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st * result.append(curr[0]); */ goto __pyx_L3_continue; - goto __pyx_L5; } - __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":955 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":961 * if curr[0] >= len(_columns): * continue * if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: # <<<<<<<<<<<<<< * result.append(curr[0]); * curr_col = _columns[curr[0]] */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_5, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_5, __pyx_v_result, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_t_6; } else { @@ -47763,37 +50014,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":956 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":962 * continue * if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: * result.append(curr[0]); # <<<<<<<<<<<<<< * curr_col = _columns[curr[0]] * for alt in curr_col: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6; } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":957 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":963 * if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: * result.append(curr[0]); * curr_col = _columns[curr[0]] # <<<<<<<<<<<<<< * for alt in curr_col: * next_id = curr[0]+alt[2] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetItem(__pyx_v__columns, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v__columns, __pyx_t_1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_curr_col, __pyx_t_5); __pyx_t_5 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":958 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":964 * result.append(curr[0]); * curr_col = _columns[curr[0]] * for alt in curr_col: # <<<<<<<<<<<<<< @@ -47804,7 +50055,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __pyx_t_5 = __pyx_v_curr_col; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_curr_col); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_curr_col); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; } @@ -47812,23 +50063,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 964; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -47837,25 +50089,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __Pyx_XDECREF_SET(__pyx_v_alt, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":959 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":965 * curr_col = _columns[curr[0]] * for alt in curr_col: * next_id = curr[0]+alt[2] # <<<<<<<<<<<<<< * jump = 1 * if alt[0] == EPSILON: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_next_id, __pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":960 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":966 * for alt in curr_col: * next_id = curr[0]+alt[2] * jump = 1 # <<<<<<<<<<<<<< @@ -47865,25 +50117,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __Pyx_INCREF(__pyx_int_1); __Pyx_XDECREF_SET(__pyx_v_jump, __pyx_int_1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":961 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":967 * next_id = curr[0]+alt[2] * jump = 1 * if alt[0] == EPSILON: # <<<<<<<<<<<<<< * jump = 0 * if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: */ - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __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); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __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_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":962 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":968 * jump = 1 * if alt[0] == EPSILON: * jump = 0 # <<<<<<<<<<<<<< @@ -47896,30 +50148,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":963 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":969 * if alt[0] == EPSILON: * jump = 0 * if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: # <<<<<<<<<<<<<< * candidate.append([next_id,curr[1]+jump]) * return sorted(result); */ - __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_next_id, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_next_id, __pyx_v_result, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_7) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); - __pyx_t_10 = PyInt_FromLong((__pyx_v_self->max_initial_size + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_From_long((__pyx_v_self->max_initial_size + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __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_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __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 = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_4; } else { @@ -47927,19 +50179,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":964 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":970 * jump = 0 * if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: * candidate.append([next_id,curr[1]+jump]) # <<<<<<<<<<<<<< * return sorted(result); * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_next_id); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_next_id); @@ -47947,8 +50199,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_candidate, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_candidate, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L10; } __pyx_L10:; @@ -47957,7 +50209,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st __pyx_L3_continue:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":965 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":971 * if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: * candidate.append([next_id,curr[1]+jump]) * return sorted(result); # <<<<<<<<<<<<<< @@ -47965,20 +50217,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st * def input(self, fwords, meta, ctx_name=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_result)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":953 + * return min + * + * def get_next_states(self, _columns, curr_idx, min_dist=2): # <<<<<<<<<<<<<< + * result = [] + * candidate = [[curr_idx,0]] + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -48000,6 +50259,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st } static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":973 + * return sorted(result); + * + * def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<< + * '''When this function is called on the RuleFactory, + * it looks up all of the rules that can be used to translate + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4cdec_2sa_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"; @@ -48014,16 +50281,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("input (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__meta,&__pyx_n_s__ctx_name,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fwords,&__pyx_n_s_meta,&__pyx_n_s_ctx_name,0}; PyObject* values[3] = {0,0,0}; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":967 - * return sorted(result); - * - * def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<< - * '''When this function is called on the RuleFactory, - * it looks up all of the rules that can be used to translate - */ values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -48038,21 +50297,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 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: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__meta)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_meta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ctx_name); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ctx_name); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -48069,17 +50328,27 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fwords, __pyx_v_meta, __pyx_v_ctx_name); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1142 + * if len(extracts) > 0: + * fcount = Counter() + * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<< + * for (f, e, count, als), loc in extracts: + * fcount[f] += count + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3 = {__Pyx_NAMESTR("lambda3"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3, METH_NOARGS, __Pyx_DOCSTR(0)}; @@ -48088,6 +50357,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -48100,18 +50371,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambd __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1136 - * if len(extracts) > 0: - * fcount = Counter() - * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<< - * for (f, e, count, als), loc in extracts: - * fcount[f] += count - */ - static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -48123,23 +50388,22 @@ static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda4", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __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 = 1136; __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 = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyList_Type)))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyList_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyList_Type)))); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -48163,25 +50427,24 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda3", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4, 0, __pyx_n_s_125, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4, 0, __pyx_n_s_input_locals_lambda_locals_lambd, NULL, __pyx_n_s_cdec_sa__sa, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __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 = 1136; __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 = 1142; __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 = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -48194,6 +50457,14 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1148 + * for f, elist in fphrases.iteritems(): + * for e, alslist in elist.iteritems(): + * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<< + * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) + * count = len(locs) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5 = {__Pyx_NAMESTR("lambda5"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5, METH_O, __Pyx_DOCSTR(0)}; @@ -48202,18 +50473,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambd __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self, ((PyObject *)__pyx_v_x)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1142 - * for f, elist in fphrases.iteritems(): - * for e, alslist in elist.iteritems(): - * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<< - * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) - * count = len(locs) - */ - static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -48224,18 +50489,17 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda5", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __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[8]; __pyx_lineno = 1148; __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[8]; __pyx_lineno = 1142; __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[8]; __pyx_lineno = 1148; __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; + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -48247,7 +50511,7 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self } static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1182 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1188 * if self.online: * stats = self.online_stats[ctx_name] * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<< @@ -48273,12 +50537,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genex __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -48313,13 +50578,13 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) { __Pyx_RaiseClosureNameError("fwords"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) { __Pyx_RaiseClosureNameError("fwords"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -48327,23 +50592,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -48353,9 +50619,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_word, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; @@ -48375,9 +50641,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -48393,7 +50661,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":967 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":973 * return sorted(result); * * def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<< @@ -48428,12 +50696,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input(struc __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ctx_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ctx_name); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -48461,9 +50730,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; + int __pyx_t_12; int __pyx_t_13; - int __pyx_t_14; + PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; @@ -48493,9 +50762,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":978 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":984 * cdef Phrase hiero_phrase * * flen = len(fwords) # <<<<<<<<<<<<<< @@ -48504,27 +50773,27 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __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[8]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_cur_scope->__pyx_v_flen = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":979 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":985 * * flen = len(fwords) * start_time = monitor_cpu() # <<<<<<<<<<<<<< * self.extract_time = 0.0 * self.intersect_time = 0.0 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 985; __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 = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_cur_scope->__pyx_v_start_time = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":980 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":986 * flen = len(fwords) * start_time = monitor_cpu() * self.extract_time = 0.0 # <<<<<<<<<<<<<< @@ -48533,7 +50802,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_self->extract_time = 0.0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":981 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":987 * start_time = monitor_cpu() * self.extract_time = 0.0 * self.intersect_time = 0.0 # <<<<<<<<<<<<<< @@ -48542,20 +50811,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_self->intersect_time = 0.0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":982 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":988 * self.extract_time = 0.0 * self.intersect_time = 0.0 * nodes_isteps_away_buffer = {} # <<<<<<<<<<<<<< * hit = 0 * reachable_buffer = {} */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyDict_New(); 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_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":983 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":989 * self.intersect_time = 0.0 * nodes_isteps_away_buffer = {} * hit = 0 # <<<<<<<<<<<<<< @@ -48564,68 +50833,68 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_hit = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":984 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":990 * nodes_isteps_away_buffer = {} * hit = 0 * reachable_buffer = {} # <<<<<<<<<<<<<< * * # Phrase pairs processed by suffix array extractor. Do not re-extract */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_reachable_buffer = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":989 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":995 * # during online extraction. This is probably the hackiest part of * # online grammar extraction. * seen_phrases = set() # <<<<<<<<<<<<<< * * # Do not cache between sentences */ - __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PySet_New(0); 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_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_seen_phrases = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":992 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":998 * * # Do not cache between sentences * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<< * * frontier = [] */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_phrase_location, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __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_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->rules->root); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->rules->root); __pyx_cur_scope->__pyx_v_self->rules->root = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":994 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1000 * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * * frontier = [] # <<<<<<<<<<<<<< * for i in range(len(fwords)): * for alt in range(0, len(fwords[i])): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 994; __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 = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_frontier = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":995 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1001 * * frontier = [] * for i in range(len(fwords)): # <<<<<<<<<<<<<< @@ -48634,106 +50903,104 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 995; __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[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":996 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1002 * frontier = [] * for i in range(len(fwords)): * for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<< * if fwords[i][alt][0] != EPSILON: * frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_cur_scope->__pyx_v_alt = __pyx_t_7; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":997 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1003 * for i in range(len(fwords)): * for alt in range(0, len(fwords[i])): * if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<< * frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __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_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":998 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1004 * for alt in range(0, len(fwords[i])): * if fwords[i][alt][0] != EPSILON: * frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) # <<<<<<<<<<<<<< * * xroot = None */ - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); 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_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __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 = 998; __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 = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); - PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->rules->root); - PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_cur_scope->__pyx_v_self->rules->root); + PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_cur_scope->__pyx_v_self->rules->root); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->rules->root); - __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); - PyTuple_SET_ITEM(__pyx_t_12, 6, ((PyObject *)__pyx_empty_tuple)); - __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); + __Pyx_INCREF(__pyx_empty_tuple); + PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_INCREF(Py_False); + PyTuple_SET_ITEM(__pyx_t_11, 7, Py_False); + __Pyx_GIVEREF(Py_False); __pyx_t_8 = 0; __pyx_t_3 = 0; __pyx_t_10 = 0; __pyx_t_1 = 0; - __pyx_t_11 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_12)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, __pyx_t_11); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L8; } __pyx_L8:; } } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1000 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1006 * frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) * * xroot = None # <<<<<<<<<<<<<< @@ -48744,7 +51011,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(Py_None); __pyx_cur_scope->__pyx_v_xroot = Py_None; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1001 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1007 * * xroot = None * x1 = sym_setindex(self.category, 1) # <<<<<<<<<<<<<< @@ -48753,256 +51020,254 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_x1 = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1002 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1008 * xroot = None * x1 = sym_setindex(self.category, 1) * if x1 in self.rules.root.children: # <<<<<<<<<<<<<< * xroot = self.rules.root.children[x1] * else: */ - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_12, __pyx_t_11, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_11, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_14 = (__pyx_t_9 != 0); - if (__pyx_t_14) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = (__pyx_t_9 != 0); + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1003 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1009 * x1 = sym_setindex(self.category, 1) * if x1 in self.rules.root.children: * xroot = self.rules.root.children[x1] # <<<<<<<<<<<<<< * else: * xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_x1, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_xroot, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_xroot, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; goto __pyx_L9; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1005 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1011 * xroot = self.rules.root.children[x1] * else: * xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) # <<<<<<<<<<<<<< * self.rules.root.children[x1] = xroot * */ - __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_suffix_link, __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_phrase_location, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_xroot, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_xroot, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1006 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1012 * else: * xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) * self.rules.root.children[x1] = xroot # <<<<<<<<<<<<<< * * for i in range(self.min_gap_size, len(fwords)): */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_SetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_xroot, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_xroot, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L9:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1008 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1014 * self.rules.root.children[x1] = xroot * * for i in range(self.min_gap_size, len(fwords)): # <<<<<<<<<<<<<< * for alt in range(0, len(fwords[i])): * if fwords[i][alt][0] != EPSILON: */ - __pyx_t_11 = __pyx_cur_scope->__pyx_v_fwords; - __Pyx_INCREF(__pyx_t_11); - __pyx_t_2 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_1 = __pyx_cur_scope->__pyx_v_fwords; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (__pyx_t_5 = __pyx_cur_scope->__pyx_v_self->min_gap_size; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1009 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1015 * * for i in range(self.min_gap_size, len(fwords)): * for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<< * if fwords[i][alt][0] != EPSILON: * frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) */ - __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_cur_scope->__pyx_v_alt = __pyx_t_7; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1010 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1016 * for i in range(self.min_gap_size, len(fwords)): * for alt in range(0, len(fwords[i])): * if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<< * frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) * */ - __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_12, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_14) { + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1011 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1017 * for alt in range(0, len(fwords[i])): * if fwords[i][alt][0] != EPSILON: * frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) # <<<<<<<<<<<<<< * * next_states = [] */ - __pyx_t_1 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_self->min_gap_size)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_self->min_gap_size)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __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[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __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 = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_16, 2, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); - PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __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); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_xroot); - PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_cur_scope->__pyx_v_xroot); + PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_cur_scope->__pyx_v_xroot); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xroot); - PyTuple_SET_ITEM(__pyx_t_16, 6, ((PyObject *)__pyx_t_15)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_15)); - PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_1 = 0; - __pyx_t_12 = 0; + PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_14, 7, Py_True); + __Pyx_GIVEREF(Py_True); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_3 = 0; - __pyx_t_15 = 0; + __pyx_t_1 = 0; __pyx_t_8 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_16)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; + __pyx_t_15 = 0; + __pyx_t_12 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, __pyx_t_14); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L14; } __pyx_L14:; } } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1013 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1019 * frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) * * next_states = [] # <<<<<<<<<<<<<< * for i in range(len(fwords)): * next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) */ - __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_GIVEREF(((PyObject *)__pyx_t_16)); - __pyx_cur_scope->__pyx_v_next_states = ((PyObject*)__pyx_t_16); - __pyx_t_16 = 0; + __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_cur_scope->__pyx_v_next_states = ((PyObject*)__pyx_t_14); + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1014 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1020 * * next_states = [] * for i in range(len(fwords)): # <<<<<<<<<<<<<< * next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) * */ - __pyx_t_16 = __pyx_cur_scope->__pyx_v_fwords; - __Pyx_INCREF(__pyx_t_16); - __pyx_t_2 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_14 = __pyx_cur_scope->__pyx_v_fwords; + __Pyx_INCREF(__pyx_t_14); + __pyx_t_2 = PyObject_Length(__pyx_t_14); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_5; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1015 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1021 * next_states = [] * for i in range(len(fwords)): * next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) # <<<<<<<<<<<<<< * * while len(frontier) > 0: */ - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __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 = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_get_next_states); 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_15 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_fwords); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_fwords); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); - __pyx_t_8 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_15); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_8); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1017 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1023 * next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) * * while len(frontier) > 0: # <<<<<<<<<<<<<< @@ -49010,41 +51275,41 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: */ while (1) { - __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = ((__pyx_t_2 > 0) != 0); - if (!__pyx_t_14) break; + __pyx_t_2 = PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_frontier); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = ((__pyx_t_2 > 0) != 0); + if (!__pyx_t_13) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1018 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1024 * * while len(frontier) > 0: * new_frontier = [] # <<<<<<<<<<<<<< * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: * word_id = fwords[i][alt][0] */ - __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier)); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject*)__pyx_t_15)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_15)); - __pyx_t_15 = 0; + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_new_frontier); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject*)__pyx_t_8)); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1019 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1025 * while len(frontier) > 0: * new_frontier = [] * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: # <<<<<<<<<<<<<< * word_id = fwords[i][alt][0] * spanlen = fwords[i][alt][2] */ - __pyx_t_15 = ((PyObject *)__pyx_cur_scope->__pyx_v_frontier); __Pyx_INCREF(__pyx_t_15); __pyx_t_2 = 0; + __pyx_t_8 = __pyx_cur_scope->__pyx_v_frontier; __Pyx_INCREF(__pyx_t_8); __pyx_t_2 = 0; for (;;) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_15)) break; + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; + 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 @@ -49053,60 +51318,61 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 8)) { if (size > 8) __Pyx_RaiseTooManyValuesError(8); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 4); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 5); + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 3); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 4); + __pyx_t_16 = PyTuple_GET_ITEM(sequence, 5); __pyx_t_17 = PyTuple_GET_ITEM(sequence, 6); __pyx_t_18 = PyTuple_GET_ITEM(sequence, 7); } else { - __pyx_t_16 = PyList_GET_ITEM(sequence, 0); - __pyx_t_8 = PyList_GET_ITEM(sequence, 1); - __pyx_t_11 = PyList_GET_ITEM(sequence, 2); - __pyx_t_10 = PyList_GET_ITEM(sequence, 3); - __pyx_t_12 = PyList_GET_ITEM(sequence, 4); - __pyx_t_1 = PyList_GET_ITEM(sequence, 5); + __pyx_t_14 = PyList_GET_ITEM(sequence, 0); + __pyx_t_15 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_11 = PyList_GET_ITEM(sequence, 3); + __pyx_t_10 = PyList_GET_ITEM(sequence, 4); + __pyx_t_16 = PyList_GET_ITEM(sequence, 5); __pyx_t_17 = PyList_GET_ITEM(sequence, 6); __pyx_t_18 = PyList_GET_ITEM(sequence, 7); } - __Pyx_INCREF(__pyx_t_16); - __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(__pyx_t_18); #else - Py_ssize_t i; - PyObject** temps[8] = {&__pyx_t_16,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_17,&__pyx_t_18}; - for (i=0; i < 8; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(item); - *(temps[i]) = item; + { + Py_ssize_t i; + PyObject** temps[8] = {&__pyx_t_14,&__pyx_t_15,&__pyx_t_3,&__pyx_t_11,&__pyx_t_10,&__pyx_t_16,&__pyx_t_17,&__pyx_t_18}; + for (i=0; i < 8; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } } #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { Py_ssize_t index = -1; - PyObject** temps[8] = {&__pyx_t_16,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_17,&__pyx_t_18}; - __pyx_t_19 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject** temps[8] = {&__pyx_t_14,&__pyx_t_15,&__pyx_t_3,&__pyx_t_11,&__pyx_t_10,&__pyx_t_16,&__pyx_t_17,&__pyx_t_18}; + __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_19); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; for (index=0; index < 8; index++) { PyObject* item = __pyx_t_20(__pyx_t_19); if (unlikely(!item)) goto __pyx_L21_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L22_unpacking_done; @@ -49114,30 +51380,30 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L22_unpacking_done:; } - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_16); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_14); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_15); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_cur_scope->__pyx_v_k = __pyx_t_5; __pyx_cur_scope->__pyx_v_i = __pyx_t_7; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_input_match); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_input_match, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_input_match, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; __pyx_cur_scope->__pyx_v_alt = __pyx_t_21; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pathlen); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pathlen, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pathlen, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_node); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_prefix); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_prefix, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); @@ -49147,87 +51413,87 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1020 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1026 * new_frontier = [] * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: * word_id = fwords[i][alt][0] # <<<<<<<<<<<<<< * spanlen = fwords[i][alt][2] * # TODO get rid of k -- pathlen is replacing it */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_18, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_word_id); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1021 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1027 * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: * word_id = fwords[i][alt][0] * spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<< * # TODO get rid of k -- pathlen is replacing it * if word_id == EPSILON: */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__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_18 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_18, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_18, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1023 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1029 * spanlen = fwords[i][alt][2] * # TODO get rid of k -- pathlen is replacing it * if word_id == EPSILON: # <<<<<<<<<<<<<< * # skipping because word_id is epsilon * if i+spanlen >= len(fwords): */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_18 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_18 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (__pyx_t_14) { + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1025 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1031 * if word_id == EPSILON: * # skipping because word_id is epsilon * if i+spanlen >= len(fwords): # <<<<<<<<<<<<<< * continue * for nualt in range(0,len(fwords[i+spanlen])): */ - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_18); - __pyx_t_6 = PyObject_Length(__pyx_t_18); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_t_18); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_17 = PyObject_RichCompare(__pyx_t_3, __pyx_t_18, Py_GE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_17 = PyObject_RichCompare(__pyx_t_1, __pyx_t_18, Py_GE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (__pyx_t_14) { + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1026 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1032 * # skipping because word_id is epsilon * if i+spanlen >= len(fwords): * continue # <<<<<<<<<<<<<< @@ -49235,77 +51501,75 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( * frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) */ goto __pyx_L19_continue; - goto __pyx_L24; } - __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1027 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1033 * if i+spanlen >= len(fwords): * continue * for nualt in range(0,len(fwords[i+spanlen])): # <<<<<<<<<<<<<< * frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) * continue */ - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_18); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_18); if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_6 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_6; __pyx_t_21+=1) { __pyx_cur_scope->__pyx_v_nualt = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1028 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1034 * continue * for nualt in range(0,len(fwords[i+spanlen])): * frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_17); + __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_v_input_match); + PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_cur_scope->__pyx_v_input_match); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_cur_scope->__pyx_v_pathlen); + PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_cur_scope->__pyx_v_pathlen); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node); - PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_cur_scope->__pyx_v_node); + PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_cur_scope->__pyx_v_node); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_node); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prefix); - PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_cur_scope->__pyx_v_prefix); + PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_cur_scope->__pyx_v_prefix); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prefix); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_shadow_path); - PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_cur_scope->__pyx_v_is_shadow_path); + PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_cur_scope->__pyx_v_is_shadow_path); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path); __pyx_t_17 = 0; - __pyx_t_3 = 0; + __pyx_t_1 = 0; __pyx_t_18 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_t_12 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, __pyx_t_16); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1029 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1035 * for nualt in range(0,len(fwords[i+spanlen])): * frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) * continue # <<<<<<<<<<<<<< @@ -49313,67 +51577,65 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( * phrase = prefix + (word_id,) */ goto __pyx_L19_continue; - goto __pyx_L23; } - __pyx_L23:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1031 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1037 * continue * * phrase = prefix + (word_id,) # <<<<<<<<<<<<<< * hiero_phrase = Phrase(phrase) * arity = hiero_phrase.arity() */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_word_id); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_word_id); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_cur_scope->__pyx_v_word_id); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_word_id); - __pyx_t_18 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, __pyx_t_16); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_phrase); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_phrase, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1032 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1038 * * phrase = prefix + (word_id,) * hiero_phrase = Phrase(phrase) # <<<<<<<<<<<<<< * arity = hiero_phrase.arity() * */ - __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_cur_scope->__pyx_v_phrase); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_hiero_phrase, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1)); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_hiero_phrase, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_16)); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1033 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1039 * phrase = prefix + (word_id,) * hiero_phrase = Phrase(phrase) * arity = hiero_phrase.arity() # <<<<<<<<<<<<<< * * lookup_required = False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s_arity); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_cur_scope->__pyx_v_arity = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1035 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1041 * arity = hiero_phrase.arity() * * lookup_required = False # <<<<<<<<<<<<<< @@ -49382,38 +51644,38 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_lookup_required = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1036 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1042 * * lookup_required = False * if word_id in node.children: # <<<<<<<<<<<<<< * if node.children[word_id] is None: * # Path dead-ends at this node */ - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_14 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_18, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_18, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_9 = (__pyx_t_14 != 0); + __pyx_t_9 = (__pyx_t_13 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1037 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1043 * 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_1 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_16 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_9 = (__pyx_t_1 == Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_14 = (__pyx_t_9 != 0); - if (__pyx_t_14) { + __pyx_t_9 = (__pyx_t_16 == Py_None); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_13 = (__pyx_t_9 != 0); + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1039 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1045 * if node.children[word_id] is None: * # Path dead-ends at this node * continue # <<<<<<<<<<<<<< @@ -49421,47 +51683,45 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( * # Path continues at this node */ goto __pyx_L19_continue; - goto __pyx_L28; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1042 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1048 * else: * # Path continues at this node * node = node.children[word_id] # <<<<<<<<<<<<<< * else: * if node.suffix_link is None: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = PyObject_GetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_node); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; } - __pyx_L28:; goto __pyx_L27; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1044 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1050 * node = node.children[word_id] * else: * if node.suffix_link is None: # <<<<<<<<<<<<<< * # Current node is root; lookup required * lookup_required = True */ - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_14 = (__pyx_t_18 == Py_None); + __pyx_t_13 = (__pyx_t_18 == Py_None); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_9 = (__pyx_t_14 != 0); + __pyx_t_9 = (__pyx_t_13 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1046 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1052 * if node.suffix_link is None: * # Current node is root; lookup required * lookup_required = True # <<<<<<<<<<<<<< @@ -49473,56 +51733,56 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1048 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1054 * 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_14 = (__pyx_t_9 != 0); - if (__pyx_t_14) { + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_16, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_13 = (__pyx_t_9 != 0); + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1049 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1055 * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_14 = (__pyx_t_1 == Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = (__pyx_t_14 != 0); + __pyx_t_13 = (__pyx_t_16 == Py_None); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_9 = (__pyx_t_13 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1051 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1057 * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (unlikely(PyObject_SetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1052 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1058 * # Suffix link reports path is dead end * node.children[word_id] = None * continue # <<<<<<<<<<<<<< @@ -49530,11 +51790,10 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( * # Suffix link indicates lookup is reqired */ goto __pyx_L19_continue; - goto __pyx_L31; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1055 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1061 * else: * # Suffix link indicates lookup is reqired * lookup_required = True # <<<<<<<<<<<<<< @@ -49543,23 +51802,22 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_lookup_required = 1; } - __pyx_L31:; goto __pyx_L30; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1058 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1064 * else: * #ERROR: We never get here * raise Exception("Keyword trie error") # <<<<<<<<<<<<<< * # checking whether lookup_required * if lookup_required: */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_Raise(__pyx_t_16, 0, 0, 0); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L30:; } @@ -49567,7 +51825,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L27:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1060 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1066 * raise Exception("Keyword trie error") * # checking whether lookup_required * if lookup_required: # <<<<<<<<<<<<<< @@ -49577,7 +51835,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = (__pyx_cur_scope->__pyx_v_lookup_required != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1061 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1067 * # checking whether lookup_required * if lookup_required: * new_node = None # <<<<<<<<<<<<<< @@ -49589,77 +51847,85 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_new_node, Py_None); __Pyx_GIVEREF(Py_None); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1062 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1068 * 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_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1065 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1071 * # 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_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyDict_New(); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_phrase_location, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1066 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1072 * # 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); 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_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1066; __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_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_suffix_link, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1067 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1073 * 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_1, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_phrase, ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1071 + * # 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_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), __pyx_empty_tuple, __pyx_t_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_new_node, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_new_node, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; goto __pyx_L33; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1069 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1075 * phrase=hiero_phrase) * else: * if arity > 0: # <<<<<<<<<<<<<< @@ -49669,146 +51935,146 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = ((__pyx_cur_scope->__pyx_v_arity > 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1071 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1077 * if arity > 0: * # Intersecting because of arity > 0 * intersect_start_time = monitor_cpu() # <<<<<<<<<<<<<< * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) * intersect_stop_time = monitor_cpu() */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __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 = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_intersect_start_time); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_intersect_start_time, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_intersect_start_time, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1072 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1078 * # Intersecting because of arity > 0 * intersect_start_time = monitor_cpu() * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) # <<<<<<<<<<<<<< * intersect_stop_time = monitor_cpu() * self.intersect_time += intersect_stop_time - intersect_start_time */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_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_16, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __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 *)((struct __pyx_vtabstruct_4cdec_2sa_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_1, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __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_16); __pyx_t_16 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_phrase_location, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_3)); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_phrase_location, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1073 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1079 * intersect_start_time = monitor_cpu() * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) * intersect_stop_time = monitor_cpu() # <<<<<<<<<<<<<< * self.intersect_time += intersect_stop_time - intersect_start_time * else: */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1073; __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 = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_intersect_stop_time); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_intersect_stop_time, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_intersect_stop_time, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1074 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1080 * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) * intersect_stop_time = monitor_cpu() * self.intersect_time += intersect_stop_time - intersect_start_time # <<<<<<<<<<<<<< * else: * # Suffix array search */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_intersect_stop_time, __pyx_cur_scope->__pyx_v_intersect_start_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_intersect_stop_time, __pyx_cur_scope->__pyx_v_intersect_start_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_16, __pyx_t_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_18); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_18); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_cur_scope->__pyx_v_self->intersect_time = __pyx_t_4; goto __pyx_L34; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1077 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1083 * else: * # Suffix array search * phrase_location = node.phrase_location # <<<<<<<<<<<<<< * 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_phrase_location); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_phrase_location, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_18)); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1078 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1084 * # Suffix array search * phrase_location = node.phrase_location * 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_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s_lookup); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_21)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_21)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); 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); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1); + __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __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); - PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); - PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_3 = 0; + PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __pyx_t_1 = 0; + __pyx_t_16 = 0; __pyx_t_17 = 0; - __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_11, NULL); 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_18); __pyx_t_18 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sa_range); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sa_range, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sa_range, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1079 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1085 * phrase_location = node.phrase_location * 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: # <<<<<<<<<<<<<< @@ -49816,38 +52082,38 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( * else: */ __pyx_t_9 = (__pyx_cur_scope->__pyx_v_sa_range != Py_None); - __pyx_t_14 = (__pyx_t_9 != 0); - if (__pyx_t_14) { + __pyx_t_13 = (__pyx_t_9 != 0); + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1080 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1086 * 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_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); 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); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_sa_low, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_sa_high, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_phrase_location, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_10)); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_phrase_location, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_11)); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; goto __pyx_L35; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1082 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1088 * phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) * else: * phrase_location = None # <<<<<<<<<<<<<< @@ -49863,30 +52129,30 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L34:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1084 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1090 * phrase_location = None * * if phrase_location is None: # <<<<<<<<<<<<<< * node.children[word_id] = None * # Search failed */ - __pyx_t_14 = (((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location) == Py_None); - __pyx_t_9 = (__pyx_t_14 != 0); + __pyx_t_13 = (((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location) == Py_None); + __pyx_t_9 = (__pyx_t_13 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1085 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1091 * * if phrase_location is None: * node.children[word_id] = None # <<<<<<<<<<<<<< * # Search failed * continue */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); 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); - if (PyObject_SetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1087 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1093 * node.children[word_id] = None * # Search failed * continue # <<<<<<<<<<<<<< @@ -49894,112 +52160,118 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( * suffix_link = self.rules.root */ goto __pyx_L19_continue; - goto __pyx_L36; } - __pyx_L36:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1089 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1095 * continue * # Search succeeded * suffix_link = self.rules.root # <<<<<<<<<<<<<< * if node.suffix_link is not None: * suffix_link = node.suffix_link.children[word_id] */ - __pyx_t_10 = __pyx_cur_scope->__pyx_v_self->rules->root; - __Pyx_INCREF(__pyx_t_10); + __pyx_t_11 = __pyx_cur_scope->__pyx_v_self->rules->root; + __Pyx_INCREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_suffix_link); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1090 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1096 * # 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_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = (__pyx_t_10 != Py_None); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_14 = (__pyx_t_9 != 0); - if (__pyx_t_14) { + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_suffix_link); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = (__pyx_t_11 != Py_None); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_13 = (__pyx_t_9 != 0); + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1091 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1097 * 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_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_suffix_link); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; goto __pyx_L37; } __pyx_L37:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1092 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1098 * 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_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_phrase_location, ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1093 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1099 * 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_10, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_suffix_link, __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1094 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1100 * 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_10, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_phrase, ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1098 + * 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_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), __pyx_empty_tuple, __pyx_t_11); 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(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_new_node, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_new_node, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; } __pyx_L33:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1095 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1101 * suffix_link=suffix_link, * phrase=hiero_phrase) * node.children[word_id] = new_node # <<<<<<<<<<<<<< * node = new_node * */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - if (PyObject_SetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (unlikely(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 = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1096 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1102 * phrase=hiero_phrase) * node.children[word_id] = new_node * node = new_node # <<<<<<<<<<<<<< @@ -50011,41 +52283,41 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_cur_scope->__pyx_v_new_node); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_node); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1101 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1107 * This should happen before we get to extraction (so that * the node will exist if needed)''' * if arity < self.max_nonterminals: # <<<<<<<<<<<<<< * xcat_index = arity+1 * xcat = sym_setindex(self.category, xcat_index) */ - __pyx_t_14 = ((__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals) != 0); - if (__pyx_t_14) { + __pyx_t_13 = ((__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals) != 0); + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1102 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1108 * 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_12 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = __Pyx_PyInt_From_long((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xcat_index); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1103 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1109 * 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_21 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_cur_scope->__pyx_v_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_21); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1104 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1110 * xcat_index = arity+1 * xcat = sym_setindex(self.category, xcat_index) * suffix_link_xcat_index = xcat_index # <<<<<<<<<<<<<< @@ -50057,194 +52329,194 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index, __pyx_cur_scope->__pyx_v_xcat_index); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xcat_index); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1105 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1111 * 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_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_14) { + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1106 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1112 * 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_12 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __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 = 1112; __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_SET(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; goto __pyx_L39; } __pyx_L39:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1107 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1113 * 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_21 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_cur_scope->__pyx_v_suffix_link_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_21); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1108 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1114 * 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_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_phrase_location); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_phrase_location, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1109 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1115 * 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 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_suffix_link); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_suffix_link_xcat, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_suffix_link, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1110 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1116 * 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_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); 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_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - PyTuple_SET_ITEM(__pyx_t_18, 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_18)); 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_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, __pyx_t_18); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_18), NULL); 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_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_phrase, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1108 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1114 * 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_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_SetItemInt(__pyx_t_12, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_10, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (unlikely(__Pyx_SetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_11, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L38; } __pyx_L38:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1113 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1119 * * # sample from range * if not is_shadow_path: # <<<<<<<<<<<<<< * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = ( node.phrase_location).num_subpatterns */ - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = ((!__pyx_t_14) != 0); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((!__pyx_t_13) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1114 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1120 * # sample from range * if not is_shadow_path: * sample = self.sampler.sample(node.phrase_location) # <<<<<<<<<<<<<< * num_subpatterns = ( node.phrase_location).num_subpatterns * chunklen = IntList(initial_len=num_subpatterns) */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s_sample); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_18, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample)); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sample, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_12)); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sample, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_10)); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1115 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1121 * if not is_shadow_path: * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = ( node.phrase_location).num_subpatterns # <<<<<<<<<<<<<< * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_21 = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_12)->num_subpatterns; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_phrase_location); 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_21 = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_10)->num_subpatterns; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1116 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1122 * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = ( 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_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); 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_18 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_initial_len, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_chunklen)); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunklen, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_18)); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1117 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1123 * num_subpatterns = ( node.phrase_location).num_subpatterns * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: # <<<<<<<<<<<<<< @@ -50254,7 +52526,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_21 = __pyx_cur_scope->__pyx_v_num_subpatterns; for (__pyx_cur_scope->__pyx_v_j = 0; __pyx_cur_scope->__pyx_v_j < __pyx_t_21; __pyx_cur_scope->__pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1118 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1124 * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) # <<<<<<<<<<<<<< @@ -50264,21 +52536,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( (__pyx_cur_scope->__pyx_v_chunklen->arr[__pyx_cur_scope->__pyx_v_j]) = ((struct __pyx_vtabstruct_4cdec_2sa_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); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1119 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1125 * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) * extracts = [] # <<<<<<<<<<<<<< * j = 0 * extract_start = monitor_cpu() */ - __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extracts); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extracts, ((PyObject*)__pyx_t_18)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_18)); + __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1120 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1126 * chunklen.arr[j] = hiero_phrase.chunklen(j) * extracts = [] * j = 0 # <<<<<<<<<<<<<< @@ -50287,24 +52559,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_j = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1121 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1127 * extracts = [] * j = 0 * extract_start = monitor_cpu() # <<<<<<<<<<<<<< * while j < sample.len: * extract = [] */ - __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_12 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_start); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extract_start, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extract_start, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1122 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1128 * j = 0 * extract_start = monitor_cpu() * while j < sample.len: # <<<<<<<<<<<<<< @@ -50315,21 +52587,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = ((__pyx_cur_scope->__pyx_v_j < __pyx_cur_scope->__pyx_v_sample->len) != 0); if (!__pyx_t_9) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1123 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1129 * extract_start = monitor_cpu() * while j < sample.len: * extract = [] # <<<<<<<<<<<<<< * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) */ - __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extract, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1125 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1131 * extract = [] * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -50338,115 +52610,106 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_f_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1126 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1132 * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) * loc = tuple(sample[j:j+num_subpatterns]) # <<<<<<<<<<<<<< * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) * extracts.extend([(e, loc) for e in extract]) */ - __pyx_t_12 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_cur_scope->__pyx_v_sample), __pyx_cur_scope->__pyx_v_j, (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns), NULL, NULL, NULL, 1, 1, 1); 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_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_cur_scope->__pyx_v_sample), __pyx_cur_scope->__pyx_v_j, (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_18), NULL); 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(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_18, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_loc); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_loc, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_loc, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1127 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1133 * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) * loc = tuple(sample[j:j+num_subpatterns]) * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) # <<<<<<<<<<<<<< * extracts.extend([(e, loc) for e in extract]) * j = j + num_subpatterns */ - __pyx_t_12 = ((struct __pyx_vtabstruct_4cdec_2sa_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_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = ((struct __pyx_vtabstruct_4cdec_2sa_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_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_extract); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_extract, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_extract, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1128 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1134 * loc = tuple(sample[j:j+num_subpatterns]) * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) * extracts.extend([(e, loc) for e in extract]) # <<<<<<<<<<<<<< * j = j + num_subpatterns * */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_extract) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_extract)) { - __pyx_t_10 = __pyx_cur_scope->__pyx_v_extract; __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0; + __pyx_t_18 = __pyx_cur_scope->__pyx_v_extract; __Pyx_INCREF(__pyx_t_18); __pyx_t_6 = 0; __pyx_t_22 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_22 = Py_TYPE(__pyx_t_10)->tp_iternext; + __pyx_t_6 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_22 = Py_TYPE(__pyx_t_18)->tp_iternext; } for (;;) { - if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_10)) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break; + if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_18)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_18)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_17 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_17 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PySequence_ITEM(__pyx_t_18, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_10)) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_10)) break; + } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_18)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_18)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_17 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PySequence_ITEM(__pyx_t_18, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_17 = __pyx_t_22(__pyx_t_10); - if (unlikely(!__pyx_t_17)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __pyx_t_22(__pyx_t_18); + if (unlikely(!__pyx_t_11)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(__pyx_t_11); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_17); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_t_17 = 0; - __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); - PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_cur_scope->__pyx_v_e); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_loc); - PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_cur_scope->__pyx_v_loc); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_cur_scope->__pyx_v_loc); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_loc); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_18, (PyObject*)__pyx_t_17))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_18)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_18)); - __pyx_t_18 = 0; - __pyx_t_18 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_12 = __Pyx_PyList_Extend(__pyx_cur_scope->__pyx_v_extracts, __pyx_t_10); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1129 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1135 * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) * extracts.extend([(e, loc) for e in extract]) * j = j + num_subpatterns # <<<<<<<<<<<<<< @@ -50456,7 +52719,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1131 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1137 * j = j + num_subpatterns * * num_samples = sample.len/num_subpatterns # <<<<<<<<<<<<<< @@ -50467,130 +52730,130 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __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))) { + else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_cur_scope->__pyx_v_num_subpatterns == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_cur_scope->__pyx_v_sample->len))) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_OverflowError, "value too large to perform division"); + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1132 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1138 * * 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_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_stop); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extract_stop, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extract_stop, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1133 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1139 * num_samples = sample.len/num_subpatterns * extract_stop = monitor_cpu() * self.extract_time = self.extract_time + extract_stop - extract_start # <<<<<<<<<<<<<< * if len(extracts) > 0: * fcount = Counter() */ - __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_18 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Subtract(__pyx_t_18, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyNumber_Subtract(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_18); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_cur_scope->__pyx_v_self->extract_time = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1134 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1140 * extract_stop = monitor_cpu() * self.extract_time = self.extract_time + extract_stop - extract_start * if len(extracts) > 0: # <<<<<<<<<<<<<< * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) */ - __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_extracts); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = ((__pyx_t_6 > 0) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1135 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1141 * self.extract_time = self.extract_time + extract_stop - extract_start * if len(extracts) > 0: * fcount = Counter() # <<<<<<<<<<<<<< * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) * for (f, e, count, als), loc in extracts: */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__Counter); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_18 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_Counter); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_fcount); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1136 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1142 * if len(extracts) > 0: * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<< * for (f, e, count, als), loc in extracts: * fcount[f] += count */ - __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3, 0, __pyx_n_s_128, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __pyx_t_18 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3, 0, __pyx_n_s_input_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_fphrases); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_fphrases, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_fphrases, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1137 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1143 * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) * for (f, e, count, als), loc in extracts: # <<<<<<<<<<<<<< * fcount[f] += count * fphrases[f][e][als].append(loc) */ - __pyx_t_10 = ((PyObject *)__pyx_cur_scope->__pyx_v_extracts); __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0; + __pyx_t_18 = __pyx_cur_scope->__pyx_v_extracts; __Pyx_INCREF(__pyx_t_18); __pyx_t_6 = 0; for (;;) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break; + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_18)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PySequence_ITEM(__pyx_t_18, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { - PyObject* sequence = __pyx_t_12; + if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) { + PyObject* sequence = __pyx_t_11; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else @@ -50599,49 +52862,48 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_18 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_18 = PyList_GET_ITEM(sequence, 0); + __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_17 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_18); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_17); #else - __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); #endif - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else - { + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else { Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; - index = 0; __pyx_t_18 = __pyx_t_20(__pyx_t_1); if (unlikely(!__pyx_t_18)) goto __pyx_L50_unpacking_failed; - __Pyx_GOTREF(__pyx_t_18); - index = 1; __pyx_t_17 = __pyx_t_20(__pyx_t_1); if (unlikely(!__pyx_t_17)) goto __pyx_L50_unpacking_failed; + __pyx_t_16 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_10 = __pyx_t_20(__pyx_t_16); if (unlikely(!__pyx_t_10)) goto __pyx_L50_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + index = 1; __pyx_t_17 = __pyx_t_20(__pyx_t_16); if (unlikely(!__pyx_t_17)) goto __pyx_L50_unpacking_failed; __Pyx_GOTREF(__pyx_t_17); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_16), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L51_unpacking_done; __pyx_L50_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L51_unpacking_done:; } - if ((likely(PyTuple_CheckExact(__pyx_t_18))) || (PyList_CheckExact(__pyx_t_18))) { - PyObject* sequence = __pyx_t_18; + 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 @@ -50650,80 +52912,81 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); + __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_15 = PyTuple_GET_ITEM(sequence, 3); } else { - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_11 = PyList_GET_ITEM(sequence, 2); - __pyx_t_8 = PyList_GET_ITEM(sequence, 3); + __pyx_t_16 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_15 = PyList_GET_ITEM(sequence, 3); } + __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_15); #else - Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_11,&__pyx_t_8}; - for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(item); - *(temps[i]) = item; + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_16,&__pyx_t_1,&__pyx_t_3,&__pyx_t_15}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } } #endif - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - } else - { + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else { Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_11,&__pyx_t_8}; - __pyx_t_16 = PyObject_GetIter(__pyx_t_18); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_20 = Py_TYPE(__pyx_t_16)->tp_iternext; + PyObject** temps[4] = {&__pyx_t_16,&__pyx_t_1,&__pyx_t_3,&__pyx_t_15}; + __pyx_t_14 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_14)->tp_iternext; for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_20(__pyx_t_16); if (unlikely(!item)) goto __pyx_L52_unpacking_failed; + PyObject* item = __pyx_t_20(__pyx_t_14); if (unlikely(!item)) goto __pyx_L52_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_16), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_14), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L53_unpacking_done; __pyx_L52_unpacking_failed:; - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L53_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_f, __pyx_t_1); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_f, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_3); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_count, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_count, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_als); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_als, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_als, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __pyx_t_15 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_loc); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_loc, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1138 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1144 * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) * for (f, e, count, als), loc in extracts: * fcount[f] += count # <<<<<<<<<<<<<< @@ -50731,39 +52994,37 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( * for f, elist in fphrases.iteritems(): */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - __pyx_t_12 = __pyx_cur_scope->__pyx_v_f; - __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __pyx_cur_scope->__pyx_v_f; + __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_11); if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_17, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_t_17, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_11, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1139 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1145 * for (f, e, count, als), loc in extracts: * fcount[f] += count * fphrases[f][e][als].append(loc) # <<<<<<<<<<<<<< * for f, elist in fphrases.iteritems(): * for e, alslist in elist.iteritems(): */ - __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fphrases, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_18 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = __Pyx_PyObject_Append(__pyx_t_12, __pyx_cur_scope->__pyx_v_loc); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_11 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fphrases, __pyx_cur_scope->__pyx_v_f); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyObject_GetItem(__pyx_t_11, __pyx_cur_scope->__pyx_v_e); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_als); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_11, __pyx_cur_scope->__pyx_v_loc); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1140 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1146 * fcount[f] += count * fphrases[f][e][als].append(loc) * for f, elist in fphrases.iteritems(): # <<<<<<<<<<<<<< @@ -50773,29 +53034,29 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_6 = 0; if (unlikely(__pyx_cur_scope->__pyx_v_fphrases == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_18 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_21)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_XDECREF(__pyx_t_10); - __pyx_t_10 = __pyx_t_18; - __pyx_t_18 = 0; + __pyx_t_11 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, __pyx_n_s_iteritems, (&__pyx_t_23), (&__pyx_t_21)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_18); + __pyx_t_18 = __pyx_t_11; + __pyx_t_11 = 0; while (1) { - __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_23, &__pyx_t_6, &__pyx_t_18, &__pyx_t_12, NULL, __pyx_t_21); + __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_18, __pyx_t_23, &__pyx_t_6, &__pyx_t_11, &__pyx_t_10, NULL, __pyx_t_21); if (unlikely(__pyx_t_7 == 0)) break; - if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_GOTREF(__pyx_t_12); + if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_f, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_f, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_elist); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_elist, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_elist, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1141 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1147 * fphrases[f][e][als].append(loc) * for f, elist in fphrases.iteritems(): * for e, alslist in elist.iteritems(): # <<<<<<<<<<<<<< @@ -50805,57 +53066,57 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_24 = 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 = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_18 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_25), (&__pyx_t_7)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_XDECREF(__pyx_t_12); - __pyx_t_12 = __pyx_t_18; - __pyx_t_18 = 0; + __pyx_t_11 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, __pyx_n_s_iteritems, (&__pyx_t_25), (&__pyx_t_7)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_10); + __pyx_t_10 = __pyx_t_11; + __pyx_t_11 = 0; while (1) { - __pyx_t_5 = __Pyx_dict_iter_next(__pyx_t_12, __pyx_t_25, &__pyx_t_24, &__pyx_t_18, &__pyx_t_17, NULL, __pyx_t_7); + __pyx_t_5 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_25, &__pyx_t_24, &__pyx_t_11, &__pyx_t_17, NULL, __pyx_t_7); if (unlikely(__pyx_t_5 == 0)) break; - if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alslist); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_alslist, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1142 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1148 * for f, elist in fphrases.iteritems(): * for e, alslist in elist.iteritems(): * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<< * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) * count = len(locs) */ - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; - __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_18)); - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5, 0, __pyx_n_s_128, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_18, ((PyObject *)__pyx_n_s__key), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_17), ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { - PyObject* sequence = __pyx_t_8; + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5, 0, __pyx_n_s_input_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_key, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_17, __pyx_t_11); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + 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 @@ -50864,236 +53125,243 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_18 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_18 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 0); __pyx_t_17 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_18); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_17); #else - __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); #endif - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - { + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } else { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; + index = 0; __pyx_t_11 = __pyx_t_20(__pyx_t_3); if (unlikely(!__pyx_t_11)) goto __pyx_L58_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_20 = Py_TYPE(__pyx_t_11)->tp_iternext; - index = 0; __pyx_t_18 = __pyx_t_20(__pyx_t_11); if (unlikely(!__pyx_t_18)) goto __pyx_L58_unpacking_failed; - __Pyx_GOTREF(__pyx_t_18); - index = 1; __pyx_t_17 = __pyx_t_20(__pyx_t_11); if (unlikely(!__pyx_t_17)) goto __pyx_L58_unpacking_failed; + index = 1; __pyx_t_17 = __pyx_t_20(__pyx_t_3); if (unlikely(!__pyx_t_17)) goto __pyx_L58_unpacking_failed; __Pyx_GOTREF(__pyx_t_17); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L59_unpacking_done; __pyx_L58_unpacking_failed:; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L59_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_alignment, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_alignment, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_max_locs); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_max_locs, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1143 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1149 * for e, alslist in elist.iteritems(): * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) # <<<<<<<<<<<<<< * count = len(locs) * scores = self.scorer.score(FeatureContext( */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__itertools); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__chain); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_itertools); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_chain); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_from_iterable); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; - __pyx_t_18 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; - __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; - __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; - __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_locs, ((PyObject*)__pyx_t_18)); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1144 + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_17, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_locs); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_locs, ((PyObject*)__pyx_t_11)); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1150 * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) * count = len(locs) # <<<<<<<<<<<<<< * scores = self.scorer.score(FeatureContext( * f, e, count, fcount[f], num_samples, */ - __pyx_t_26 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_26 = PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_locs); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_count, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_count, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1145 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1151 * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) * count = len(locs) * scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<< * f, e, count, fcount[f], num_samples, * (k,i+spanlen), locs, input_match, */ - __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_FeatureContext); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1146 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1152 * count = len(locs) * scores = self.scorer.score(FeatureContext( * f, e, count, fcount[f], num_samples, # <<<<<<<<<<<<<< * (k,i+spanlen), locs, input_match, * fwords, self.fda, self.eda, */ - __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_17); - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1147 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1153 * scores = self.scorer.score(FeatureContext( * f, e, count, fcount[f], num_samples, * (k,i+spanlen), locs, input_match, # <<<<<<<<<<<<<< * fwords, self.fda, self.eda, * meta, */ - __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __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(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_11 = 0; - __pyx_t_1 = 0; + __pyx_t_16 = PyNumber_Add(__pyx_t_1, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__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 = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_3 = 0; + __pyx_t_16 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1151 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1157 * meta, * # Include online stats. None if none. * self.online_ctx_lookup(f, e, ctx_name))) # <<<<<<<<<<<<<< * # Phrase pair processed * if self.online: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_online_ctx_lookup); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_11, 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_11, 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_ctx_name); - PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_cur_scope->__pyx_v_ctx_name); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_ctx_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ctx_name); - __pyx_t_16 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1151 + * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) + * count = len(locs) + * scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<< + * f, e, count, fcount[f], num_samples, + * (k,i+spanlen), locs, input_match, + */ + __pyx_t_3 = PyTuple_New(13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_11, 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_11, 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_11, 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_11, 3, __pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); - PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_11, 5, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); - PyTuple_SET_ITEM(__pyx_t_11, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_locs)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_locs); + PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_cur_scope->__pyx_v_locs); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_locs); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match); - PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_cur_scope->__pyx_v_input_match); + PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_cur_scope->__pyx_v_input_match); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords); - PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_cur_scope->__pyx_v_fwords); + PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_cur_scope->__pyx_v_fwords); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda)); - PyTuple_SET_ITEM(__pyx_t_11, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda)); + PyTuple_SET_ITEM(__pyx_t_3, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda)); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda)); - PyTuple_SET_ITEM(__pyx_t_11, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda)); + PyTuple_SET_ITEM(__pyx_t_3, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda)); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_meta); - PyTuple_SET_ITEM(__pyx_t_11, 11, __pyx_cur_scope->__pyx_v_meta); + PyTuple_SET_ITEM(__pyx_t_3, 11, __pyx_cur_scope->__pyx_v_meta); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_meta); - PyTuple_SET_ITEM(__pyx_t_11, 12, __pyx_t_16); - __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_3, 12, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); __pyx_t_17 = 0; - __pyx_t_8 = 0; - __pyx_t_3 = 0; - __pyx_t_16 = 0; - __pyx_t_16 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_16)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_15 = 0; + __pyx_t_1 = 0; + __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_14)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_scores, ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_t_11)); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_scores, ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_t_3)); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1153 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1159 * self.online_ctx_lookup(f, e, ctx_name))) * # Phrase pair processed * if self.online: # <<<<<<<<<<<<<< @@ -51103,67 +53371,67 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = (__pyx_cur_scope->__pyx_v_self->online != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1154 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1160 * # Phrase pair processed * if self.online: * seen_phrases.add((f, e)) # <<<<<<<<<<<<<< * yield Rule(self.category, f, e, scores, alignment) * */ - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_11, 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_11, 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_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; + __pyx_t_12 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, __pyx_t_3); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L60; } __pyx_L60:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1155 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1161 * if self.online: * seen_phrases.add((f, e)) * yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<< * * if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size: */ - __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_16 = PyTuple_New(5); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = PyTuple_New(5); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __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_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_cur_scope->__pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_14, 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_16, 2, __pyx_cur_scope->__pyx_v_e); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); - PyTuple_SET_ITEM(__pyx_t_16, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores)); + PyTuple_SET_ITEM(__pyx_t_14, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_alignment); - PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_cur_scope->__pyx_v_alignment); + PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_cur_scope->__pyx_v_alignment); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment); - __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; - __pyx_r = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; + __Pyx_XGIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); - __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; - __Pyx_XGIVEREF(__pyx_t_12); - __pyx_cur_scope->__pyx_t_4 = __pyx_t_12; - __Pyx_XGIVEREF(__pyx_t_15); - __pyx_cur_scope->__pyx_t_5 = __pyx_t_15; + __pyx_cur_scope->__pyx_t_4 = __pyx_t_10; + __Pyx_XGIVEREF(__pyx_t_18); + __pyx_cur_scope->__pyx_t_5 = __pyx_t_18; __pyx_cur_scope->__pyx_t_6 = __pyx_t_21; __pyx_cur_scope->__pyx_t_7 = __pyx_t_23; __pyx_cur_scope->__pyx_t_8 = __pyx_t_24; @@ -51177,24 +53445,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; - __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_8 = __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_XGOTREF(__pyx_t_8); + __pyx_t_10 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; - __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_15 = __pyx_cur_scope->__pyx_t_5; + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_18 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; - __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_18); __pyx_t_21 = __pyx_cur_scope->__pyx_t_6; __pyx_t_23 = __pyx_cur_scope->__pyx_t_7; __pyx_t_24 = __pyx_cur_scope->__pyx_t_8; __pyx_t_25 = __pyx_cur_scope->__pyx_t_9; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L47; } __pyx_L47:; @@ -51205,121 +53473,121 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L32:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1157 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1163 * yield Rule(self.category, f, e, scores, 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, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) */ - __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_23 < __pyx_cur_scope->__pyx_v_self->max_length); if (__pyx_t_9) { - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __pyx_cur_scope->__pyx_v_fwords; - __Pyx_INCREF(__pyx_t_10); - __pyx_t_23 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_10 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __pyx_cur_scope->__pyx_v_fwords; + __Pyx_INCREF(__pyx_t_18); + __pyx_t_23 = PyObject_Length(__pyx_t_18); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_t_18, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__pyx_t_14) { - __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_13) { + __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 = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_18, Py_LE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_28 = __pyx_t_27; } else { - __pyx_t_28 = __pyx_t_14; + __pyx_t_28 = __pyx_t_13; } - __pyx_t_14 = __pyx_t_28; + __pyx_t_13 = __pyx_t_28; } else { - __pyx_t_14 = __pyx_t_9; + __pyx_t_13 = __pyx_t_9; } - if (__pyx_t_14) { + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1158 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1164 * * 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, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) * num_subpatterns = arity */ - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyNumber_Add(__pyx_t_12, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_10); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_18 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_18); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_23 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_23 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_23; __pyx_t_21+=1) { __pyx_cur_scope->__pyx_v_alt_id = __pyx_t_21; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1159 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1165 * 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, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) # <<<<<<<<<<<<<< * num_subpatterns = arity * if not is_shadow_path: */ - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_16 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_14 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = PyTuple_New(8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match); - PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_cur_scope->__pyx_v_input_match); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_cur_scope->__pyx_v_input_match); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match); - PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_16); - __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node); - PyTuple_SET_ITEM(__pyx_t_18, 5, __pyx_cur_scope->__pyx_v_node); + PyTuple_SET_ITEM(__pyx_t_11, 5, __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_18, 6, __pyx_cur_scope->__pyx_v_phrase); + PyTuple_SET_ITEM(__pyx_t_11, 6, __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_18, 7, __pyx_cur_scope->__pyx_v_is_shadow_path); + PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_cur_scope->__pyx_v_is_shadow_path); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path); - __pyx_t_12 = 0; - __pyx_t_11 = 0; __pyx_t_10 = 0; - __pyx_t_16 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_18)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; + __pyx_t_3 = 0; + __pyx_t_18 = 0; + __pyx_t_14 = 0; + __pyx_t_12 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, __pyx_t_11); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1160 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1166 * for alt_id in range(len(fwords[i+spanlen])): * new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) * num_subpatterns = arity # <<<<<<<<<<<<<< @@ -51328,18 +53596,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_cur_scope->__pyx_v_arity; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1161 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1167 * new_frontier.append((k, i+spanlen, input_match, 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_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = ((!__pyx_t_14) != 0); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((!__pyx_t_13) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1162 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1168 * num_subpatterns = arity * if not is_shadow_path: * num_subpatterns = num_subpatterns + 1 # <<<<<<<<<<<<<< @@ -51351,30 +53619,30 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( } __pyx_L65:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1163 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1169 * 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_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (((__pyx_t_23 + 1) < __pyx_cur_scope->__pyx_v_self->max_length) != 0); if (__pyx_t_9) { - __pyx_t_14 = ((__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals) != 0); - if (__pyx_t_14) { + __pyx_t_13 = ((__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals) != 0); + if (__pyx_t_13) { __pyx_t_28 = ((__pyx_cur_scope->__pyx_v_num_subpatterns < __pyx_cur_scope->__pyx_v_self->max_chunks) != 0); __pyx_t_27 = __pyx_t_28; } else { - __pyx_t_27 = __pyx_t_14; + __pyx_t_27 = __pyx_t_13; } - __pyx_t_14 = __pyx_t_27; + __pyx_t_13 = __pyx_t_27; } else { - __pyx_t_14 = __pyx_t_9; + __pyx_t_13 = __pyx_t_9; } - if (__pyx_t_14) { + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1164 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1170 * 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) # <<<<<<<<<<<<<< @@ -51383,155 +53651,155 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( */ __pyx_cur_scope->__pyx_v_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, (__pyx_cur_scope->__pyx_v_arity + 1)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1165 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1171 * 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_xcat, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xnode); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_xnode, __pyx_t_16); - __Pyx_GIVEREF(__pyx_t_16); - __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_xnode, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1167 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1173 * 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_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_18 = PyList_New(4); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_16); - __Pyx_GIVEREF(__pyx_t_16); - PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); + PyList_SET_ITEM(__pyx_t_18, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyList_SET_ITEM(__pyx_t_18, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_10, 2, __pyx_int_1); + PyList_SET_ITEM(__pyx_t_18, 2, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen); - PyList_SET_ITEM(__pyx_t_10, 3, __pyx_cur_scope->__pyx_v_pathlen); + PyList_SET_ITEM(__pyx_t_18, 3, __pyx_cur_scope->__pyx_v_pathlen); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen); - __pyx_t_16 = 0; - __pyx_t_18 = 0; - __pyx_t_18 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_10))); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_18)); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_key)); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, ((PyObject*)__pyx_t_18)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_18)); - __pyx_t_18 = 0; + __pyx_t_14 = 0; + __pyx_t_11 = 0; + __pyx_t_11 = PyList_AsTuple(((PyObject*)__pyx_t_18)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, ((PyObject*)__pyx_t_11)); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1168 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1174 * # 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_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_frontier_nodes, ((PyObject *)__pyx_t_18)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_18)); - __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_frontier_nodes, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1169 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1175 * 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_14 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_key), ((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = (__pyx_t_14 != 0); + __pyx_t_13 = (__Pyx_PyDict_Contains(__pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_13 != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1170 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1176 * 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_18 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer, __pyx_cur_scope->__pyx_v_key); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_frontier_nodes, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_frontier_nodes, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; goto __pyx_L67; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1172 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1178 * 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_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_129); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __pyx_t_11 = PyTuple_New(7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_get_all_nodes_isteps_away); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_16); - __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_3 = PyTuple_New(7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); __Pyx_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_11, 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_11, 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_11, 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_11, 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_11, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer)); - __pyx_t_10 = 0; - __pyx_t_16 = 0; - __pyx_t_16 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_next_states); + PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_cur_scope->__pyx_v_next_states); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_next_states); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_reachable_buffer); + PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_cur_scope->__pyx_v_reachable_buffer); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_reachable_buffer); + __pyx_t_18 = 0; + __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_frontier_nodes, __pyx_t_16); - __Pyx_GIVEREF(__pyx_t_16); - __pyx_t_16 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_frontier_nodes, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1173 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1179 * 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 = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_frontier_nodes) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L67:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1175 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1181 * nodes_isteps_away_buffer[key] = frontier_nodes * * for i, alt, pathlen in frontier_nodes: # <<<<<<<<<<<<<< @@ -51539,41 +53807,42 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( * frontier = new_frontier */ if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes)) { - __pyx_t_16 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_16); __pyx_t_23 = 0; + __pyx_t_14 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_14); __pyx_t_23 = 0; __pyx_t_22 = NULL; } else { - __pyx_t_23 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __pyx_t_22 = Py_TYPE(__pyx_t_16)->tp_iternext; + __pyx_t_23 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_22 = Py_TYPE(__pyx_t_14)->tp_iternext; } for (;;) { - if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_16)) { - if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_16)) break; + if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_14)) { + if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_14)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_16, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_16)) { - if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_16)) break; + } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_14)) { + if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_14)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_16, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_11 = __pyx_t_22(__pyx_t_16); - if (unlikely(!__pyx_t_11)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_22(__pyx_t_14); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_3); } - if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) { - PyObject* sequence = __pyx_t_11; + 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 @@ -51582,128 +53851,127 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_18 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); } else { - __pyx_t_18 = PyList_GET_ITEM(sequence, 0); - __pyx_t_10 = PyList_GET_ITEM(sequence, 1); - __pyx_t_12 = PyList_GET_ITEM(sequence, 2); + __pyx_t_11 = PyList_GET_ITEM(sequence, 0); + __pyx_t_18 = PyList_GET_ITEM(sequence, 1); + __pyx_t_10 = PyList_GET_ITEM(sequence, 2); } + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_12); #else - __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __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 = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); #endif - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } else - { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; - index = 0; __pyx_t_18 = __pyx_t_20(__pyx_t_3); if (unlikely(!__pyx_t_18)) goto __pyx_L70_unpacking_failed; + __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_11 = __pyx_t_20(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L70_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_1); if (unlikely(!__pyx_t_18)) goto __pyx_L70_unpacking_failed; __Pyx_GOTREF(__pyx_t_18); - index = 1; __pyx_t_10 = __pyx_t_20(__pyx_t_3); if (unlikely(!__pyx_t_10)) goto __pyx_L70_unpacking_failed; + index = 2; __pyx_t_10 = __pyx_t_20(__pyx_t_1); if (unlikely(!__pyx_t_10)) goto __pyx_L70_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); - index = 2; __pyx_t_12 = __pyx_t_20(__pyx_t_3); if (unlikely(!__pyx_t_12)) goto __pyx_L70_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_1), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L71_unpacking_done; __pyx_L70_unpacking_failed:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L71_unpacking_done:; } - __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_cur_scope->__pyx_v_i = __pyx_t_21; __pyx_cur_scope->__pyx_v_alt = __pyx_t_7; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pathlen); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pathlen, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pathlen, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1176 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1182 * * for i, alt, pathlen in frontier_nodes: * new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) # <<<<<<<<<<<<<< * frontier = new_frontier * */ - __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, __pyx_t_11); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __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 = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyTuple_New(8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 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_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen); - PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_pathlen); + PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_cur_scope->__pyx_v_pathlen); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_xnode); - PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_cur_scope->__pyx_v_xnode); + PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_cur_scope->__pyx_v_xnode); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xnode); - PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_15, 6, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_shadow_path); - PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_cur_scope->__pyx_v_is_shadow_path); + PyTuple_SET_ITEM(__pyx_t_15, 7, __pyx_cur_scope->__pyx_v_is_shadow_path); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path); - __pyx_t_11 = 0; - __pyx_t_12 = 0; + __pyx_t_3 = 0; __pyx_t_10 = 0; __pyx_t_18 = 0; - __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __pyx_t_11 = 0; + __pyx_t_1 = 0; + __pyx_t_12 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, __pyx_t_15); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L66; } __pyx_L66:; @@ -51712,22 +53980,22 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_L62:; __pyx_L19_continue:; } - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1177 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1183 * for i, alt, pathlen in frontier_nodes: * new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) * frontier = new_frontier # <<<<<<<<<<<<<< * * # Online rule extraction and scoring */ - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier)); - __Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_new_frontier); + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_frontier, __pyx_cur_scope->__pyx_v_new_frontier); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier)); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_frontier); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1180 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1186 * * # Online rule extraction and scoring * if self.online: # <<<<<<<<<<<<<< @@ -51737,95 +54005,96 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __pyx_t_9 = (__pyx_cur_scope->__pyx_v_self->online != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1181 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1187 * # Online rule extraction and scoring * if self.online: * stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<< * f_syms = tuple(word[0][0] for word in fwords) * for f, lex_i, lex_j in self.get_f_phrases(f_syms): */ - __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_cur_scope->__pyx_v_ctx_name); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_cur_scope->__pyx_v_stats = __pyx_t_15; - __pyx_t_15 = 0; + __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_cur_scope->__pyx_v_ctx_name); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_stats = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1182 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1188 * if self.online: * stats = self.online_stats[ctx_name] * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<< * for f, lex_i, lex_j in self.get_f_phrases(f_syms): * spanlen = (lex_j - lex_i) + 1 */ - __pyx_t_15 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; - __Pyx_GIVEREF(__pyx_t_15); - __pyx_cur_scope->__pyx_v_f_syms = ((PyObject*)__pyx_t_15); - __pyx_t_15 = 0; + __pyx_t_8 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_14, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_f_syms = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1183 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1189 * stats = self.online_stats[ctx_name] * f_syms = tuple(word[0][0] for word in fwords) * for f, lex_i, lex_j in self.get_f_phrases(f_syms): # <<<<<<<<<<<<<< * spanlen = (lex_j - lex_i) + 1 * if not sym_isvar(f[0]): */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms)); - PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_f_syms)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms)); - __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_get_f_phrases); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; - if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_16 = __pyx_t_8; __Pyx_INCREF(__pyx_t_16); __pyx_t_2 = 0; + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_syms); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_cur_scope->__pyx_v_f_syms); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_syms); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (PyList_CheckExact(__pyx_t_15) || PyTuple_CheckExact(__pyx_t_15)) { + __pyx_t_14 = __pyx_t_15; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0; __pyx_t_22 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __pyx_t_22 = Py_TYPE(__pyx_t_16)->tp_iternext; + __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_22 = Py_TYPE(__pyx_t_14)->tp_iternext; } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; for (;;) { - if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_16)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_16)) break; + if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_14)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_15); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_16)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_16)) break; + } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_14)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_15); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_8 = __pyx_t_22(__pyx_t_16); - if (unlikely(!__pyx_t_8)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __pyx_t_22(__pyx_t_14); + if (unlikely(!__pyx_t_15)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_15); } - if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { - PyObject* sequence = __pyx_t_8; + 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 @@ -51834,391 +54103,399 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_18 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); } else { - __pyx_t_15 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_18 = PyList_GET_ITEM(sequence, 2); + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + __pyx_t_11 = PyList_GET_ITEM(sequence, 2); } - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_18); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); #endif - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - { + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_20 = Py_TYPE(__pyx_t_10)->tp_iternext; - index = 0; __pyx_t_15 = __pyx_t_20(__pyx_t_10); if (unlikely(!__pyx_t_15)) goto __pyx_L75_unpacking_failed; - __Pyx_GOTREF(__pyx_t_15); - index = 1; __pyx_t_3 = __pyx_t_20(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L75_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 2; __pyx_t_18 = __pyx_t_20(__pyx_t_10); if (unlikely(!__pyx_t_18)) goto __pyx_L75_unpacking_failed; + __pyx_t_18 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_18)->tp_iternext; + index = 0; __pyx_t_8 = __pyx_t_20(__pyx_t_18); if (unlikely(!__pyx_t_8)) goto __pyx_L75_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_1 = __pyx_t_20(__pyx_t_18); if (unlikely(!__pyx_t_1)) goto __pyx_L75_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 2; __pyx_t_11 = __pyx_t_20(__pyx_t_18); if (unlikely(!__pyx_t_11)) goto __pyx_L75_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_18), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_20 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L76_unpacking_done; __pyx_L75_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L76_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_f, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_f, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lex_i); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_lex_i, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_lex_i, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lex_j); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_lex_j, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_lex_j, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1184 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1190 * f_syms = tuple(word[0][0] for word in fwords) * for f, lex_i, lex_j in self.get_f_phrases(f_syms): * spanlen = (lex_j - lex_i) + 1 # <<<<<<<<<<<<<< * if not sym_isvar(f[0]): * spanlen += 1 */ - __pyx_t_8 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_18 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_15 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_11 = PyNumber_Add(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1185 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1191 * for f, lex_i, lex_j in self.get_f_phrases(f_syms): * spanlen = (lex_j - lex_i) + 1 * if not sym_isvar(f[0]): # <<<<<<<<<<<<<< * spanlen += 1 * if not sym_isvar(f[1]): */ - __pyx_t_18 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_9 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_7) != 0)) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1186 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1192 * spanlen = (lex_j - lex_i) + 1 * if not sym_isvar(f[0]): * spanlen += 1 # <<<<<<<<<<<<<< * if not sym_isvar(f[1]): * spanlen += 1 */ - __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; goto __pyx_L77; } __pyx_L77:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1187 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1193 * if not sym_isvar(f[0]): * spanlen += 1 * if not sym_isvar(f[1]): # <<<<<<<<<<<<<< * spanlen += 1 * for e in stats.phrases_fe.get(f, ()): */ - __pyx_t_18 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_9 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_7) != 0)) != 0); if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1188 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1194 * spanlen += 1 * if not sym_isvar(f[1]): * spanlen += 1 # <<<<<<<<<<<<<< * for e in stats.phrases_fe.get(f, ()): * if (f, e) not in seen_phrases: */ - __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; goto __pyx_L78; } __pyx_L78:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1189 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1195 * if not sym_isvar(f[1]): * spanlen += 1 * for e in stats.phrases_fe.get(f, ()): # <<<<<<<<<<<<<< * if (f, e) not in seen_phrases: * # Don't add multiple instances of the same phrase here */ - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__get); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s_phrases_fe); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_get); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_cur_scope->__pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_f); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f); - __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); - PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)__pyx_empty_tuple)); - __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_18 = __pyx_t_3; __Pyx_INCREF(__pyx_t_18); __pyx_t_23 = 0; + __Pyx_INCREF(__pyx_empty_tuple); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __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_11); __pyx_t_11 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); __pyx_t_23 = 0; __pyx_t_29 = NULL; } else { - __pyx_t_23 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_29 = Py_TYPE(__pyx_t_18)->tp_iternext; + __pyx_t_23 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_29 = Py_TYPE(__pyx_t_11)->tp_iternext; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (!__pyx_t_29 && PyList_CheckExact(__pyx_t_18)) { - if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_18)) break; + if (!__pyx_t_29 && PyList_CheckExact(__pyx_t_11)) { + if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_11)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_23); __Pyx_INCREF(__pyx_t_1); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_18, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - } else if (!__pyx_t_29 && PyTuple_CheckExact(__pyx_t_18)) { - if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_18)) break; + } else if (!__pyx_t_29 && PyTuple_CheckExact(__pyx_t_11)) { + if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_11)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_23); __Pyx_INCREF(__pyx_t_1); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_18, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_3 = __pyx_t_29(__pyx_t_18); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_t_29(__pyx_t_11); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1190 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1196 * spanlen += 1 * for e in stats.phrases_fe.get(f, ()): * if (f, e) not in seen_phrases: # <<<<<<<<<<<<<< * # Don't add multiple instances of the same phrase here * seen_phrases.add((f, e)) */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_1, 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_3, 1, __pyx_cur_scope->__pyx_v_e); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); - __pyx_t_9 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_14 = (__pyx_t_9 != 0); - if (__pyx_t_14) { + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_1, __pyx_cur_scope->__pyx_v_seen_phrases, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = (__pyx_t_9 != 0); + if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1192 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1198 * if (f, e) not in seen_phrases: * # Don't add multiple instances of the same phrase here * seen_phrases.add((f, e)) # <<<<<<<<<<<<<< * scores = self.scorer.score(FeatureContext( * f, e, 0, 0, 0, */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_1, 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_3, 1, __pyx_cur_scope->__pyx_v_e); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); - __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_12 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, __pyx_t_1); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1193 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1199 * # Don't add multiple instances of the same phrase here * seen_phrases.add((f, e)) * scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<< * f, e, 0, 0, 0, * spanlen, None, None, */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FeatureContext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1198 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1204 * fwords, self.fda, self.eda, * meta, * self.online_ctx_lookup(f, e, ctx_name))) # <<<<<<<<<<<<<< * alignment = stats.phrases_al[f][e] * yield Rule(self.category, f, e, scores, alignment) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_online_ctx_lookup); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __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_8, 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_8, 1, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ctx_name); - PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_cur_scope->__pyx_v_ctx_name); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_cur_scope->__pyx_v_ctx_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ctx_name); - __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_8, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(13); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1199 + * # Don't add multiple instances of the same phrase here + * seen_phrases.add((f, e)) + * scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<< + * f, e, 0, 0, 0, + * spanlen, None, None, + */ + __pyx_t_8 = PyTuple_New(13); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __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_8, 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_8, 1, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_spanlen); - PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_cur_scope->__pyx_v_spanlen); + PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_cur_scope->__pyx_v_spanlen); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_spanlen); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_15, 6, Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 6, Py_None); __Pyx_GIVEREF(Py_None); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_15, 7, Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 7, Py_None); __Pyx_GIVEREF(Py_None); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords); - PyTuple_SET_ITEM(__pyx_t_15, 8, __pyx_cur_scope->__pyx_v_fwords); + PyTuple_SET_ITEM(__pyx_t_8, 8, __pyx_cur_scope->__pyx_v_fwords); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda)); - PyTuple_SET_ITEM(__pyx_t_15, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda)); + PyTuple_SET_ITEM(__pyx_t_8, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda)); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda)); - PyTuple_SET_ITEM(__pyx_t_15, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda)); + PyTuple_SET_ITEM(__pyx_t_8, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda)); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_meta); - PyTuple_SET_ITEM(__pyx_t_15, 11, __pyx_cur_scope->__pyx_v_meta); + PyTuple_SET_ITEM(__pyx_t_8, 11, __pyx_cur_scope->__pyx_v_meta); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_meta); - PyTuple_SET_ITEM(__pyx_t_15, 12, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __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_15)); __pyx_t_15 = 0; - __pyx_t_15 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_10)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + PyTuple_SET_ITEM(__pyx_t_8, 12, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_scores, ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_t_15)); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_scores, ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_t_8)); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1199 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1205 * meta, * self.online_ctx_lookup(f, e, ctx_name))) * alignment = stats.phrases_al[f][e] # <<<<<<<<<<<<<< * yield Rule(self.category, f, e, scores, alignment) * */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __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_f); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __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_e); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s_phrases_al); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_18 = PyObject_GetItem(__pyx_t_8, __pyx_cur_scope->__pyx_v_f); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_e); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_alignment, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_alignment, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1200 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1206 * self.online_ctx_lookup(f, e, ctx_name))) * alignment = stats.phrases_al[f][e] * yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<< * * stop_time = monitor_cpu() */ - __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __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_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_18 = PyTuple_New(5); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_18, 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_10, 2, __pyx_cur_scope->__pyx_v_e); + PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); - PyTuple_SET_ITEM(__pyx_t_10, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores)); + PyTuple_SET_ITEM(__pyx_t_18, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_alignment); - PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_cur_scope->__pyx_v_alignment); + PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_cur_scope->__pyx_v_alignment); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment); - __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __pyx_r = __pyx_t_15; - __pyx_t_15 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; - __Pyx_XGIVEREF(__pyx_t_16); - __pyx_cur_scope->__pyx_t_3 = __pyx_t_16; - __Pyx_XGIVEREF(__pyx_t_18); - __pyx_cur_scope->__pyx_t_4 = __pyx_t_18; + __Pyx_XGIVEREF(__pyx_t_11); + __pyx_cur_scope->__pyx_t_3 = __pyx_t_11; + __Pyx_XGIVEREF(__pyx_t_14); + __pyx_cur_scope->__pyx_t_4 = __pyx_t_14; __pyx_cur_scope->__pyx_t_10 = __pyx_t_22; __pyx_cur_scope->__pyx_t_1 = __pyx_t_23; __pyx_cur_scope->__pyx_t_11 = __pyx_t_29; @@ -52229,146 +54506,156 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( return __pyx_r; __pyx_L82_resume_from_yield:; __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; - __pyx_t_16 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_11 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_t_16); - __pyx_t_18 = __pyx_cur_scope->__pyx_t_4; + __Pyx_XGOTREF(__pyx_t_11); + __pyx_t_14 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; - __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_14); __pyx_t_22 = __pyx_cur_scope->__pyx_t_10; __pyx_t_23 = __pyx_cur_scope->__pyx_t_1; __pyx_t_29 = __pyx_cur_scope->__pyx_t_11; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L81; } __pyx_L81:; } - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L72; } __pyx_L72:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1202 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1208 * yield Rule(self.category, f, e, scores, alignment) * * stop_time = monitor_cpu() # <<<<<<<<<<<<<< * logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time)) * gc.collect() */ - __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __pyx_t_18 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_GIVEREF(__pyx_t_18); - __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_18; - __pyx_t_18 = 0; + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_monitor_cpu); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GIVEREF(__pyx_t_11); + __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_11; + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1203 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1209 * * 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_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__info); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_15 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_18); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_130)); - PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_kp_s_130)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_130)); - PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_info); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_kp_s_Total_time_for_rule_lookup_extra); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_kp_s_Total_time_for_rule_lookup_extra); + __Pyx_GIVEREF(__pyx_kp_s_Total_time_for_rule_lookup_extra); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1204 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1210 * 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) * logger.info(" Intersect time = %f seconds", self.intersect_time) */ - __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__gc); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__collect); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1205 + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_collect); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1211 * 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) # <<<<<<<<<<<<<< * logger.info(" Intersect time = %f seconds", self.intersect_time) * */ - __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_131)); - PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_kp_s_131)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_131)); - PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_info); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_kp_s_Extract_time_f_seconds); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_kp_s_Extract_time_f_seconds); + __Pyx_GIVEREF(__pyx_kp_s_Extract_time_f_seconds); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_14, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1206 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1212 * gc.collect() * logger.info(" Extract time = %f seconds", self.extract_time) * logger.info(" Intersect time = %f seconds", self.intersect_time) # <<<<<<<<<<<<<< * * */ - __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_132)); - PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_kp_s_132)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_132)); - PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_info); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_kp_s_Intersect_time_f_seconds); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_kp_s_Intersect_time_f_seconds); + __Pyx_GIVEREF(__pyx_kp_s_Intersect_time_f_seconds); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":973 + * return sorted(result); + * + * def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<< + * '''When this function is called on the RuleFactory, + * it looks up all of the rules that can be used to translate + */ + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -52377,7 +54664,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); @@ -52392,7 +54679,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4( return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1209 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1215 * * * cdef int find_fixpoint(self, # <<<<<<<<<<<<<< @@ -52422,7 +54709,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_fixpoint", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1224 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1230 * 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 # <<<<<<<<<<<<<< @@ -52431,7 +54718,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_e_low[0]) = __pyx_v_e_in_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1225 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1231 * * e_low[0] = e_in_low * e_high[0] = e_in_high # <<<<<<<<<<<<<< @@ -52440,19 +54727,19 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_e_high[0]) = __pyx_v_e_in_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1226 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1232 * 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 = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_f_high); 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_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1227 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1233 * 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: # <<<<<<<<<<<<<< @@ -52462,7 +54749,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_3 = (((__pyx_v_e_low[0]) == -1) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1233 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1239 * # rule X -> X_1 w X_2 / X_1 X_2. This is probably * # not worth the bother, though. * return 0 # <<<<<<<<<<<<<< @@ -52471,10 +54758,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L3; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1234 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1240 * # not worth the bother, though. * return 0 * elif e_in_low != -1 and e_low[0] != e_in_low: # <<<<<<<<<<<<<< @@ -52490,7 +54776,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1235 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1241 * return 0 * elif e_in_low != -1 and e_low[0] != e_in_low: * if e_in_low - e_low[0] < min_ex_size: # <<<<<<<<<<<<<< @@ -52500,7 +54786,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_5 = (((__pyx_v_e_in_low - (__pyx_v_e_low[0])) < __pyx_v_min_ex_size) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1236 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1242 * 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 # <<<<<<<<<<<<<< @@ -52509,7 +54795,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_e_low[0]) = (__pyx_v_e_in_low - __pyx_v_min_ex_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1237 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1243 * if e_in_low - e_low[0] < min_ex_size: * e_low[0] = e_in_low - min_ex_size * if e_low[0] < 0: # <<<<<<<<<<<<<< @@ -52519,7 +54805,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_5 = (((__pyx_v_e_low[0]) < 0) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1238 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1244 * e_low[0] = e_in_low - min_ex_size * if e_low[0] < 0: * return 0 # <<<<<<<<<<<<<< @@ -52528,9 +54814,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L5; } - __pyx_L5:; goto __pyx_L4; } __pyx_L4:; @@ -52538,7 +54822,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1240 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1246 * return 0 * * if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<< @@ -52548,7 +54832,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_5 = ((((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1241 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1247 * * if e_high[0] - e_low[0] > max_e_len: * return 0 # <<<<<<<<<<<<<< @@ -52557,10 +54841,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L6; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1242 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1248 * if e_high[0] - e_low[0] > max_e_len: * return 0 * elif e_in_high != -1 and e_high[0] != e_in_high: # <<<<<<<<<<<<<< @@ -52576,7 +54859,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1243 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1249 * return 0 * elif e_in_high != -1 and e_high[0] != e_in_high: * if e_high[0] - e_in_high < min_ex_size: # <<<<<<<<<<<<<< @@ -52586,7 +54869,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((((__pyx_v_e_high[0]) - __pyx_v_e_in_high) < __pyx_v_min_ex_size) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1244 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1250 * 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 # <<<<<<<<<<<<<< @@ -52595,7 +54878,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_e_high[0]) = (__pyx_v_e_in_high + __pyx_v_min_ex_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1245 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1251 * 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: # <<<<<<<<<<<<<< @@ -52605,7 +54888,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_e_high[0]) > __pyx_v_e_sent_len) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1246 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1252 * e_high[0] = e_in_high + min_ex_size * if e_high[0] > e_sent_len: * return 0 # <<<<<<<<<<<<<< @@ -52614,9 +54897,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L8; } - __pyx_L8:; goto __pyx_L7; } __pyx_L7:; @@ -52624,7 +54905,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1248 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1254 * return 0 * * f_back_low[0] = -1 # <<<<<<<<<<<<<< @@ -52633,7 +54914,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_f_back_low[0]) = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1249 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1255 * * f_back_low[0] = -1 * f_back_high[0] = -1 # <<<<<<<<<<<<<< @@ -52642,7 +54923,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_f_back_high[0]) = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1250 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1256 * f_back_low[0] = -1 * f_back_high[0] = -1 * f_low_prev = f_low # <<<<<<<<<<<<<< @@ -52651,17 +54932,17 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_f_low_prev = __pyx_v_f_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1251 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1257 * 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 = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f_high_prev = __pyx_t_1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1252 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1258 * f_low_prev = f_low * f_high_prev = f_high * new_x = 0 # <<<<<<<<<<<<<< @@ -52670,7 +54951,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_x = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1253 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1259 * f_high_prev = f_high * new_x = 0 * new_low_x = 0 # <<<<<<<<<<<<<< @@ -52679,7 +54960,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_low_x = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1254 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1260 * new_x = 0 * new_low_x = 0 * new_high_x = 0 # <<<<<<<<<<<<<< @@ -52688,7 +54969,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_high_x = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1256 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1262 * new_high_x = 0 * * while True: # <<<<<<<<<<<<<< @@ -52696,9 +54977,8 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct * if f_back_low[0] == -1: */ while (1) { - if (!1) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1258 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1264 * while True: * * if f_back_low[0] == -1: # <<<<<<<<<<<<<< @@ -52708,45 +54988,45 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_f_back_low[0]) == -1) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1259 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1265 * * 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_4cdec_2sa_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 = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1265; __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*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1261 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1267 * 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_4cdec_2sa_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 = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1262 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1268 * 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_4cdec_2sa_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 = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L11:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1264 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1270 * 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: # <<<<<<<<<<<<<< @@ -52756,7 +55036,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_f_back_low[0]) > __pyx_v_f_low) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1265 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1271 * * if f_back_low[0] > f_low: * f_back_low[0] = f_low # <<<<<<<<<<<<<< @@ -52768,35 +55048,35 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L12:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1267 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1273 * 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 = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1273; __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); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 1267; __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 = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1268 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1274 * * 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 = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_f_back_high[0]) = __pyx_t_1; goto __pyx_L13; } __pyx_L13:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1270 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1276 * f_back_high[0] = f_high * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: # <<<<<<<<<<<<<< @@ -52812,7 +55092,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1271 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1277 * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: * return 1 # <<<<<<<<<<<<<< @@ -52821,11 +55101,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L14; } - __pyx_L14:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1273 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1279 * return 1 * * if allow_low_x == 0 and f_back_low[0] < f_low: # <<<<<<<<<<<<<< @@ -52841,7 +55119,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1275 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1281 * if allow_low_x == 0 and f_back_low[0] < f_low: * # FAIL: f phrase is not tight * return 0 # <<<<<<<<<<<<<< @@ -52850,11 +55128,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L15; } - __pyx_L15:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1277 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1283 * return 0 * * if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<< @@ -52864,7 +55140,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_5 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0); if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1279 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1285 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: f back projection is too wide * return 0 # <<<<<<<<<<<<<< @@ -52873,11 +55149,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L16; } - __pyx_L16:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1281 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1287 * return 0 * * if allow_high_x == 0 and f_back_high[0] > f_high: # <<<<<<<<<<<<<< @@ -52886,11 +55160,11 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __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 = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1287; __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); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 1281; __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 = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_3; } else { @@ -52898,7 +55172,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1283 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1289 * if allow_high_x == 0 and f_back_high[0] > f_high: * # FAIL: extension on high side not allowed * return 0 # <<<<<<<<<<<<<< @@ -52907,11 +55181,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L17; } - __pyx_L17:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1285 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1291 * return 0 * * if f_low != f_back_low[0]: # <<<<<<<<<<<<<< @@ -52921,7 +55193,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((__pyx_v_f_low != (__pyx_v_f_back_low[0])) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1286 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1292 * * if f_low != f_back_low[0]: * if new_low_x == 0: # <<<<<<<<<<<<<< @@ -52931,7 +55203,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((__pyx_v_new_low_x == 0) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1287 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1293 * if f_low != f_back_low[0]: * if new_low_x == 0: * if new_x >= max_new_x: # <<<<<<<<<<<<<< @@ -52941,7 +55213,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((__pyx_v_new_x >= __pyx_v_max_new_x) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1289 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1295 * if new_x >= max_new_x: * # FAIL: extension required on low side violates max # of gaps * return 0 # <<<<<<<<<<<<<< @@ -52950,11 +55222,10 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L20; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1291 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1297 * return 0 * else: * new_x = new_x + 1 # <<<<<<<<<<<<<< @@ -52963,7 +55234,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_x = (__pyx_v_new_x + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1292 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1298 * else: * new_x = new_x + 1 * new_low_x = 1 # <<<<<<<<<<<<<< @@ -52972,12 +55243,11 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_low_x = 1; } - __pyx_L20:; goto __pyx_L19; } __pyx_L19:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1293 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1299 * new_x = new_x + 1 * new_low_x = 1 * if f_low - f_back_low[0] < min_fx_size: # <<<<<<<<<<<<<< @@ -52987,7 +55257,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_f_low - (__pyx_v_f_back_low[0])) < __pyx_v_min_fx_size) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1294 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1300 * new_low_x = 1 * if f_low - f_back_low[0] < min_fx_size: * f_back_low[0] = f_low - min_fx_size # <<<<<<<<<<<<<< @@ -52996,7 +55266,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ (__pyx_v_f_back_low[0]) = (__pyx_v_f_low - __pyx_v_min_fx_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1295 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1301 * 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: # <<<<<<<<<<<<<< @@ -53006,7 +55276,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1297 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1303 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on low side violates max initial length * return 0 # <<<<<<<<<<<<<< @@ -53015,11 +55285,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L22; } - __pyx_L22:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1298 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1304 * # FAIL: extension required on low side violates max initial length * return 0 * if f_back_low[0] < 0: # <<<<<<<<<<<<<< @@ -53029,7 +55297,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_f_back_low[0]) < 0) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1300 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1306 * if f_back_low[0] < 0: * # FAIL: extension required on low side violates sentence boundary * return 0 # <<<<<<<<<<<<<< @@ -53038,9 +55306,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L23; } - __pyx_L23:; goto __pyx_L21; } __pyx_L21:; @@ -53048,22 +55314,22 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L18:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1302 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1308 * 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 = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1308; __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); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 1302; __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 = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1303 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1309 * * if f_high != f_back_high[0]: * if new_high_x == 0: # <<<<<<<<<<<<<< @@ -53073,7 +55339,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((__pyx_v_new_high_x == 0) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1304 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1310 * if f_high != f_back_high[0]: * if new_high_x == 0: * if new_x >= max_new_x: # <<<<<<<<<<<<<< @@ -53083,7 +55349,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((__pyx_v_new_x >= __pyx_v_max_new_x) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1306 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1312 * if new_x >= max_new_x: * # FAIL: extension required on high side violates max # of gaps * return 0 # <<<<<<<<<<<<<< @@ -53092,11 +55358,10 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L26; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1308 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1314 * return 0 * else: * new_x = new_x + 1 # <<<<<<<<<<<<<< @@ -53105,7 +55370,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_x = (__pyx_v_new_x + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1309 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1315 * else: * new_x = new_x + 1 * new_high_x = 1 # <<<<<<<<<<<<<< @@ -53114,49 +55379,48 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_new_high_x = 1; } - __pyx_L26:; goto __pyx_L25; } __pyx_L25:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1310 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1316 * 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 = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1316; __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 = 1310; __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 = 1316; __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 = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1316; __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); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 1310; __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 = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1311 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1317 * 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 = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1317; __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 = 1311; __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 = 1317; __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 = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1317; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1312 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1318 * 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: # <<<<<<<<<<<<<< @@ -53166,7 +55430,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1314 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1320 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on high side violates max initial length * return 0 # <<<<<<<<<<<<<< @@ -53175,11 +55439,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L28; } - __pyx_L28:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1315 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1321 * # FAIL: extension required on high side violates max initial length * return 0 * if f_back_high[0] > f_sent_len: # <<<<<<<<<<<<<< @@ -53189,7 +55451,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_4 = (((__pyx_v_f_back_high[0]) > __pyx_v_f_sent_len) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1317 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1323 * if f_back_high[0] > f_sent_len: * # FAIL: extension required on high side violates sentence boundary * return 0 # <<<<<<<<<<<<<< @@ -53198,9 +55460,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L29; } - __pyx_L29:; goto __pyx_L27; } __pyx_L27:; @@ -53208,7 +55468,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1319 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1325 * return 0 * * e_low_prev = e_low[0] # <<<<<<<<<<<<<< @@ -53217,7 +55477,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_e_low_prev = (__pyx_v_e_low[0]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1320 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1326 * * e_low_prev = e_low[0] * e_high_prev = e_high[0] # <<<<<<<<<<<<<< @@ -53226,29 +55486,29 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_e_high_prev = (__pyx_v_e_high[0]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1322 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1328 * 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_4cdec_2sa_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 = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1323 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1329 * * 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_4cdec_2sa_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 = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1324 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1330 * 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: # <<<<<<<<<<<<<< @@ -53264,7 +55524,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1325 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1331 * 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 # <<<<<<<<<<<<<< @@ -53273,11 +55533,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L30; } - __pyx_L30:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1326 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1332 * if e_low[0] == e_low_prev and e_high[0] == e_high_prev: * return 1 * if allow_arbitrary_x == 0: # <<<<<<<<<<<<<< @@ -53287,7 +55545,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_3 = ((__pyx_v_allow_arbitrary_x == 0) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1328 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1334 * if allow_arbitrary_x == 0: * # FAIL: arbitrary expansion not permitted * return 0 # <<<<<<<<<<<<<< @@ -53296,11 +55554,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L31; } - __pyx_L31:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1329 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1335 * # FAIL: arbitrary expansion not permitted * return 0 * if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<< @@ -53310,7 +55566,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_t_3 = ((((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1331 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1337 * if e_high[0] - e_low[0] > max_e_len: * # FAIL: re-projection violates sentence max phrase length * return 0 # <<<<<<<<<<<<<< @@ -53319,11 +55575,9 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L32; } - __pyx_L32:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1332 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1338 * # FAIL: re-projection violates sentence max phrase length * return 0 * f_low_prev = f_back_low[0] # <<<<<<<<<<<<<< @@ -53332,7 +55586,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct */ __pyx_v_f_low_prev = (__pyx_v_f_back_low[0]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1333 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1339 * return 0 * f_low_prev = f_back_low[0] * f_high_prev = f_back_high[0] # <<<<<<<<<<<<<< @@ -53342,20 +55596,29 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_v_f_high_prev = (__pyx_v_f_back_high[0]); } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1215 + * + * + * cdef int find_fixpoint(self, # <<<<<<<<<<<<<< + * int f_low, f_high, + * int* f_links_low, int* f_links_high, + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_WriteUnraisable("cdec.sa._sa.HieroCachingRuleFactory.find_fixpoint", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("cdec.sa._sa.HieroCachingRuleFactory.find_fixpoint", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1336 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1342 * * * cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<< @@ -53373,7 +55636,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio int __pyx_t_4; __Pyx_RefNannySetupContext("find_projection", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1339 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1345 * int* out_low, int* out_high): * cdef int i * for i from in_low <= i < in_high: # <<<<<<<<<<<<<< @@ -53383,7 +55646,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio __pyx_t_1 = __pyx_v_in_high; for (__pyx_v_i = __pyx_v_in_low; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1340 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1346 * cdef int i * for i from in_low <= i < in_high: * if in_links_low[i] != -1: # <<<<<<<<<<<<<< @@ -53393,7 +55656,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio __pyx_t_2 = (((__pyx_v_in_links_low[__pyx_v_i]) != -1) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1341 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1347 * 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]: # <<<<<<<<<<<<<< @@ -53409,7 +55672,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio } if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1342 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1348 * 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] # <<<<<<<<<<<<<< @@ -53421,7 +55684,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1343 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1349 * 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]: # <<<<<<<<<<<<<< @@ -53437,7 +55700,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1344 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1350 * 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] # <<<<<<<<<<<<<< @@ -53453,13 +55716,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio __pyx_L5:; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1342 + * + * + * cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<< + * int* out_low, int* out_high): + * cdef int i + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1347 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1353 * * * cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<< @@ -53473,7 +55745,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("int_arr_extend", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1349 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1355 * 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 # <<<<<<<<<<<<<< @@ -53482,7 +55754,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH */ __pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_data_len); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1350 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1356 * cdef int new_len * new_len = arr_len[0] + data_len * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -53491,7 +55763,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1351 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1357 * new_len = arr_len[0] + data_len * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -53500,7 +55772,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH */ memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_data, (__pyx_v_data_len * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1352 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1358 * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) * arr_len[0] = new_len # <<<<<<<<<<<<<< @@ -53509,7 +55781,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH */ (__pyx_v_arr_len[0]) = __pyx_v_new_len; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1353 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1359 * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) * arr_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -53519,13 +55791,21 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH __pyx_r = __pyx_v_arr; goto __pyx_L0; - __pyx_r = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1353 + * + * + * 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 + */ + + /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1356 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1362 * * * 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, # <<<<<<<<<<<<<< @@ -53564,25 +55844,26 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase int __pyx_t_7; int __pyx_t_8; long __pyx_t_9; - PyObject *__pyx_t_10 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract_phrases", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1364 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1370 * cdef result * * result = [] # <<<<<<<<<<<<<< * len1 = 0 * e_gaps1 = malloc(0) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1364; __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 = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_result = ((PyObject *)__pyx_t_1); + __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1365 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1371 * * result = [] * len1 = 0 # <<<<<<<<<<<<<< @@ -53591,7 +55872,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_len1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1366 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1372 * result = [] * len1 = 0 * e_gaps1 = malloc(0) # <<<<<<<<<<<<<< @@ -53600,19 +55881,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps1 = ((int *)malloc(0)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1367 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1373 * len1 = 0 * e_gaps1 = malloc(0) * ephr_arr = IntList() # <<<<<<<<<<<<<< * * e_gap_order = malloc(num_gaps*sizeof(int)) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ephr_arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1369 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1375 * ephr_arr = IntList() * * e_gap_order = malloc(num_gaps*sizeof(int)) # <<<<<<<<<<<<<< @@ -53621,7 +55902,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gap_order = ((int *)malloc((__pyx_v_num_gaps * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1370 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1376 * * e_gap_order = malloc(num_gaps*sizeof(int)) * if num_gaps > 0: # <<<<<<<<<<<<<< @@ -53631,7 +55912,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = ((__pyx_v_num_gaps > 0) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1371 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1377 * e_gap_order = malloc(num_gaps*sizeof(int)) * if num_gaps > 0: * e_gap_order[0] = 0 # <<<<<<<<<<<<<< @@ -53640,7 +55921,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ (__pyx_v_e_gap_order[0]) = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1372 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1378 * if num_gaps > 0: * e_gap_order[0] = 0 * for i from 1 <= i < num_gaps: # <<<<<<<<<<<<<< @@ -53650,7 +55931,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1373 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1379 * e_gap_order[0] = 0 * for i from 1 <= i < num_gaps: * for j from 0 <= j < i: # <<<<<<<<<<<<<< @@ -53660,7 +55941,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_4 = __pyx_v_i; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1374 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1380 * for i from 1 <= i < num_gaps: * for j from 0 <= j < i: * if e_gap_low[i] < e_gap_low[j]: # <<<<<<<<<<<<<< @@ -53670,7 +55951,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = (((__pyx_v_e_gap_low[__pyx_v_i]) < (__pyx_v_e_gap_low[__pyx_v_j])) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1375 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1381 * for j from 0 <= j < i: * if e_gap_low[i] < e_gap_low[j]: * for k from j <= k < i: # <<<<<<<<<<<<<< @@ -53680,7 +55961,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_5 = __pyx_v_i; for (__pyx_v_k = __pyx_v_j; __pyx_v_k < __pyx_t_5; __pyx_v_k++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1376 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1382 * if e_gap_low[i] < e_gap_low[j]: * for k from j <= k < i: * e_gap_order[k+1] = e_gap_order[k] # <<<<<<<<<<<<<< @@ -53690,7 +55971,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase (__pyx_v_e_gap_order[(__pyx_v_k + 1)]) = (__pyx_v_e_gap_order[__pyx_v_k]); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1377 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1383 * for k from j <= k < i: * e_gap_order[k+1] = e_gap_order[k] * e_gap_order[j] = i # <<<<<<<<<<<<<< @@ -53699,7 +55980,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ (__pyx_v_e_gap_order[__pyx_v_j]) = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1378 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1384 * e_gap_order[k+1] = e_gap_order[k] * e_gap_order[j] = i * break # <<<<<<<<<<<<<< @@ -53707,13 +55988,11 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase * e_gap_order[i] = i */ goto __pyx_L7_break; - goto __pyx_L8; } - __pyx_L8:; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1380 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1386 * break * else: * e_gap_order[i] = i # <<<<<<<<<<<<<< @@ -53728,7 +56007,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1382 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1388 * e_gap_order[i] = i * * e_x_low = e_low # <<<<<<<<<<<<<< @@ -53737,7 +56016,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_x_low = __pyx_v_e_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1383 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1389 * * e_x_low = e_low * e_x_high = e_high # <<<<<<<<<<<<<< @@ -53746,7 +56025,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_x_high = __pyx_v_e_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1384 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1390 * e_x_low = e_low * e_x_high = e_high * if not self.tight_phrases: # <<<<<<<<<<<<<< @@ -53756,7 +56035,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = ((!(__pyx_v_self->tight_phrases != 0)) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1385 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1391 * e_x_high = e_high * if not self.tight_phrases: * 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: # <<<<<<<<<<<<<< @@ -53779,7 +56058,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (!__pyx_t_6) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1386 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1392 * if not self.tight_phrases: * 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 # <<<<<<<<<<<<<< @@ -53789,7 +56068,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_v_e_x_low = (__pyx_v_e_x_low - 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1387 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1393 * 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: # <<<<<<<<<<<<<< @@ -53812,7 +56091,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1388 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1394 * 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 # <<<<<<<<<<<<<< @@ -53825,7 +56104,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } __pyx_L11:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1390 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1396 * e_x_high = e_x_high + 1 * * for i from e_x_low <= i <= e_low: # <<<<<<<<<<<<<< @@ -53835,7 +56114,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1391 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1397 * * for i from e_x_low <= i <= e_low: * e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) # <<<<<<<<<<<<<< @@ -53845,7 +56124,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_v_e_gaps1 = ((struct __pyx_vtabstruct_4cdec_2sa_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); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1393 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1399 * e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) * * for i from 0 <= i < num_gaps: # <<<<<<<<<<<<<< @@ -53855,7 +56134,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1394 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1400 * * for i from 0 <= i < num_gaps: * e_gaps2 = malloc(0) # <<<<<<<<<<<<<< @@ -53864,7 +56143,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps2 = ((int *)malloc(0)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1395 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1401 * for i from 0 <= i < num_gaps: * e_gaps2 = malloc(0) * len2 = 0 # <<<<<<<<<<<<<< @@ -53873,7 +56152,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_len2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1397 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1403 * len2 = 0 * * j = e_gap_order[i] # <<<<<<<<<<<<<< @@ -53882,7 +56161,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_j = (__pyx_v_e_gap_order[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1398 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1404 * * j = e_gap_order[i] * e_x_gap_low = e_gap_low[j] # <<<<<<<<<<<<<< @@ -53891,7 +56170,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_x_gap_low = (__pyx_v_e_gap_low[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1399 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1405 * j = e_gap_order[i] * e_x_gap_low = e_gap_low[j] * e_x_gap_high = e_gap_high[j] # <<<<<<<<<<<<<< @@ -53900,7 +56179,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_x_gap_high = (__pyx_v_e_gap_high[__pyx_v_j]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1400 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1406 * e_x_gap_low = e_gap_low[j] * e_x_gap_high = e_gap_high[j] * if not self.tight_phrases: # <<<<<<<<<<<<<< @@ -53910,7 +56189,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = ((!(__pyx_v_self->tight_phrases != 0)) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1401 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1407 * e_x_gap_high = e_gap_high[j] * if not self.tight_phrases: * while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1: # <<<<<<<<<<<<<< @@ -53927,7 +56206,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1402 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1408 * if not self.tight_phrases: * 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 # <<<<<<<<<<<<<< @@ -53937,7 +56216,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_v_e_x_gap_low = (__pyx_v_e_x_gap_low - 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1403 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1409 * 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: # <<<<<<<<<<<<<< @@ -53954,7 +56233,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (!__pyx_t_6) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1404 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1410 * 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 # <<<<<<<<<<<<<< @@ -53967,7 +56246,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } __pyx_L20:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1406 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1412 * e_x_gap_high = e_x_gap_high + 1 * * k = 0 # <<<<<<<<<<<<<< @@ -53976,7 +56255,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_k = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1407 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1413 * * k = 0 * step = 1+(i*2) # <<<<<<<<<<<<<< @@ -53985,7 +56264,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_step = (1 + (__pyx_v_i * 2)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1408 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1414 * k = 0 * step = 1+(i*2) * while k < len1: # <<<<<<<<<<<<<< @@ -53996,7 +56275,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_6 = ((__pyx_v_k < __pyx_v_len1) != 0); if (!__pyx_t_6) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1409 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1415 * step = 1+(i*2) * while k < len1: * for m from e_x_gap_low <= m <= e_gap_low[j]: # <<<<<<<<<<<<<< @@ -54006,7 +56285,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1410 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1416 * while k < len1: * for m from e_x_gap_low <= m <= e_gap_low[j]: * if m >= e_gaps1[k+step-1]: # <<<<<<<<<<<<<< @@ -54016,7 +56295,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_6 = ((__pyx_v_m >= (__pyx_v_e_gaps1[((__pyx_v_k + __pyx_v_step) - 1)])) != 0); if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1411 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1417 * 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: # <<<<<<<<<<<<<< @@ -54026,7 +56305,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1412 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1418 * 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 # <<<<<<<<<<<<<< @@ -54036,7 +56315,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_6 = (((__pyx_v_n - __pyx_v_m) >= 1) != 0); if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1413 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1419 * 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) # <<<<<<<<<<<<<< @@ -54045,7 +56324,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1414 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1420 * 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) # <<<<<<<<<<<<<< @@ -54054,7 +56333,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1415 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1421 * 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) # <<<<<<<<<<<<<< @@ -54071,7 +56350,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_L29:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1416 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1422 * 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 # <<<<<<<<<<<<<< @@ -54081,7 +56360,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_v_k = (__pyx_v_k + __pyx_v_step); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1417 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1423 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) * k = k + step * free(e_gaps1) # <<<<<<<<<<<<<< @@ -54090,7 +56369,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ free(__pyx_v_e_gaps1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1418 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1424 * k = k + step * free(e_gaps1) * e_gaps1 = e_gaps2 # <<<<<<<<<<<<<< @@ -54099,7 +56378,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps1 = __pyx_v_e_gaps2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1419 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1425 * free(e_gaps1) * e_gaps1 = e_gaps2 * len1 = len2 # <<<<<<<<<<<<<< @@ -54109,7 +56388,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_v_len1 = __pyx_v_len2; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1421 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1427 * len1 = len2 * * step = 1+(num_gaps*2) # <<<<<<<<<<<<<< @@ -54118,7 +56397,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_step = (1 + (__pyx_v_num_gaps * 2)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1422 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1428 * * step = 1+(num_gaps*2) * e_gaps2 = malloc(0) # <<<<<<<<<<<<<< @@ -54127,7 +56406,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps2 = ((int *)malloc(0)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1423 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1429 * step = 1+(num_gaps*2) * e_gaps2 = malloc(0) * len2 = 0 # <<<<<<<<<<<<<< @@ -54136,7 +56415,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_len2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1424 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1430 * e_gaps2 = malloc(0) * len2 = 0 * for i from e_high <= i <= e_x_high: # <<<<<<<<<<<<<< @@ -54146,7 +56425,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1425 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1431 * len2 = 0 * for i from e_high <= i <= e_x_high: * j = 0 # <<<<<<<<<<<<<< @@ -54155,7 +56434,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_j = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1426 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1432 * for i from e_high <= i <= e_x_high: * j = 0 * while j < len1: # <<<<<<<<<<<<<< @@ -54166,7 +56445,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_6 = ((__pyx_v_j < __pyx_v_len1) != 0); if (!__pyx_t_6) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1427 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1433 * j = 0 * while j < len1: * if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: # <<<<<<<<<<<<<< @@ -54182,7 +56461,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1428 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1434 * 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) # <<<<<<<<<<<<<< @@ -54191,7 +56470,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1429 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1435 * 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) # <<<<<<<<<<<<<< @@ -54203,7 +56482,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } __pyx_L37:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1430 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1436 * 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 # <<<<<<<<<<<<<< @@ -54214,7 +56493,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1431 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1437 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1) * j = j + step * free(e_gaps1) # <<<<<<<<<<<<<< @@ -54223,7 +56502,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ free(__pyx_v_e_gaps1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1432 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1438 * j = j + step * free(e_gaps1) * e_gaps1 = e_gaps2 # <<<<<<<<<<<<<< @@ -54232,7 +56511,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_e_gaps1 = __pyx_v_e_gaps2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1433 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1439 * free(e_gaps1) * e_gaps1 = e_gaps2 * len1 = len2 # <<<<<<<<<<<<<< @@ -54241,7 +56520,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_len1 = __pyx_v_len2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1435 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1441 * len1 = len2 * * step = (num_gaps+1)*2 # <<<<<<<<<<<<<< @@ -54250,7 +56529,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_step = ((__pyx_v_num_gaps + 1) * 2); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1436 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1442 * * step = (num_gaps+1)*2 * i = 0 # <<<<<<<<<<<<<< @@ -54259,7 +56538,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_i = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1439 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1445 * * cdef IntList indexes * while i < len1: # <<<<<<<<<<<<<< @@ -54270,7 +56549,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = ((__pyx_v_i < __pyx_v_len1) != 0); if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1440 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1446 * cdef IntList indexes * while i < len1: * ephr_arr._clear() # <<<<<<<<<<<<<< @@ -54279,7 +56558,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_clear(__pyx_v_ephr_arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1441 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1447 * while i < len1: * ephr_arr._clear() * num_chunks = 0 # <<<<<<<<<<<<<< @@ -54288,19 +56567,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_num_chunks = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1442 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1448 * ephr_arr._clear() * num_chunks = 0 * indexes = IntList() # <<<<<<<<<<<<<< * for j from 0 <= j < num_gaps+1: * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_indexes, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1443 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1449 * num_chunks = 0 * indexes = IntList() * for j from 0 <= j < num_gaps+1: # <<<<<<<<<<<<<< @@ -54310,7 +56589,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_9 = (__pyx_v_num_gaps + 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1444 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1450 * indexes = IntList() * for j from 0 <= j < num_gaps+1: * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<< @@ -54320,7 +56599,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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)])) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1445 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1451 * 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 # <<<<<<<<<<<<<< @@ -54332,7 +56611,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } __pyx_L42:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1446 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1452 * 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]: # <<<<<<<<<<<<<< @@ -54342,21 +56621,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __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++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1447 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1453 * 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 = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_10 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1448 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1454 * 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]]) # <<<<<<<<<<<<<< @@ -54364,14 +56641,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase * 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_10 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_t_4); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1449 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1455 * indexes.append(k) * ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) * if j < num_gaps: # <<<<<<<<<<<<<< @@ -54381,21 +56658,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_t_2 = ((__pyx_v_j < __pyx_v_num_gaps) != 0); if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1450 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1456 * 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_10 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_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 = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1451 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1457 * 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)) # <<<<<<<<<<<<<< @@ -54408,7 +56683,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_L45:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1452 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1458 * 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 # <<<<<<<<<<<<<< @@ -54417,7 +56692,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ __pyx_v_i = (__pyx_v_i + __pyx_v_step); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1453 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1459 * 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: # <<<<<<<<<<<<<< @@ -54433,39 +56708,37 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase } if (__pyx_t_7) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1454 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1460 * 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 = 1454; __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 = 1460; __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_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __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 = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__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 = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); __Pyx_INCREF(((PyObject *)__pyx_v_indexes)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indexes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_indexes)); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L46; } __pyx_L46:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1456 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1462 * result.append((Phrase(ephr_arr),indexes)) * * free(e_gaps1) # <<<<<<<<<<<<<< @@ -54474,7 +56747,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ free(__pyx_v_e_gaps1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1457 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1463 * * free(e_gaps1) * free(e_gap_order) # <<<<<<<<<<<<<< @@ -54483,7 +56756,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase */ free(__pyx_v_e_gap_order); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1458 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1464 * free(e_gaps1) * free(e_gap_order) * return result # <<<<<<<<<<<<<< @@ -54495,11 +56768,18 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1362 + * + * + * 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, # <<<<<<<<<<<<<< + * int f_low, int f_high, int* f_gap_low, int* f_gap_high, int* f_links_low, + * int sent_id, int e_sent_len, int e_sent_start): + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.extract_phrases", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -54511,7 +56791,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1460 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1466 * return result * * cdef IntList create_alignments(self, int* sent_links, int num_links, # <<<<<<<<<<<<<< @@ -54534,24 +56814,25 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_alignments", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1463 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1469 * IntList findexes, IntList eindexes): * cdef unsigned i * cdef IntList ret = IntList() # <<<<<<<<<<<<<< * for i in range(findexes.len): * s = findexes.arr[i] */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1464 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1470 * cdef unsigned i * cdef IntList ret = IntList() * for i in range(findexes.len): # <<<<<<<<<<<<<< @@ -54562,7 +56843,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1465 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1471 * cdef IntList ret = IntList() * for i in range(findexes.len): * s = findexes.arr[i] # <<<<<<<<<<<<<< @@ -54571,7 +56852,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa */ __pyx_v_s = (__pyx_v_findexes->arr[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1466 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1472 * for i in range(findexes.len): * s = findexes.arr[i] * if s < 0: continue # <<<<<<<<<<<<<< @@ -54581,11 +56862,9 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa __pyx_t_4 = ((__pyx_v_s < 0) != 0); if (__pyx_t_4) { goto __pyx_L3_continue; - goto __pyx_L5; } - __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1467 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1473 * s = findexes.arr[i] * if s < 0: continue * idx = 0 # <<<<<<<<<<<<<< @@ -54595,7 +56874,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1468 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1474 * if s < 0: continue * idx = 0 * while idx < num_links * 2: # <<<<<<<<<<<<<< @@ -54603,88 +56882,86 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa * 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 = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_num_links * 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __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 = 1468; __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 = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_4) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1469 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1475 * idx = 0 * while idx < num_links * 2: * if sent_links[idx] == s: # <<<<<<<<<<<<<< * j = eindexes.index(sent_links[idx+1]) * ret.append(i * ALIGNMENT_CODE + 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 = 1469; __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 = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (((__pyx_v_sent_links[__pyx_t_6]) == __pyx_v_s) != 0); if (__pyx_t_4) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1470 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1476 * while idx < num_links * 2: * if sent_links[idx] == s: * j = eindexes.index(sent_links[idx+1]) # <<<<<<<<<<<<<< * ret.append(i * ALIGNMENT_CODE + j) * idx += 2 */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_eindexes), __pyx_n_s__index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_eindexes), __pyx_n_s_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __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 = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1471 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1477 * if sent_links[idx] == s: * j = eindexes.index(sent_links[idx+1]) * ret.append(i * ALIGNMENT_CODE + j) # <<<<<<<<<<<<<< * idx += 2 * return ret */ - __pyx_t_1 = PyLong_FromUnsignedLong((__pyx_v_i * __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int((__pyx_v_i * __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L8; } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1472 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1478 * j = eindexes.index(sent_links[idx+1]) * ret.append(i * ALIGNMENT_CODE + j) * idx += 2 # <<<<<<<<<<<<<< * return ret * */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_7); + __pyx_t_7 = 0; } __pyx_L3_continue:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1473 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1479 * ret.append(i * ALIGNMENT_CODE + j) * idx += 2 * return ret # <<<<<<<<<<<<<< @@ -54696,8 +56973,15 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa __pyx_r = __pyx_v_ret; goto __pyx_L0; - __pyx_r = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1466 + * return result + * + * cdef IntList create_alignments(self, int* sent_links, int num_links, # <<<<<<<<<<<<<< + * IntList findexes, IntList eindexes): + * cdef unsigned i + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); @@ -54713,7 +56997,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1475 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1481 * return ret * * cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<< @@ -54786,8 +57070,8 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; long __pyx_t_12; Py_ssize_t __pyx_t_13; PyObject *__pyx_t_14 = NULL; @@ -54807,19 +57091,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1488 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1494 * cdef reason_for_failure * * fphr_arr = IntList() # <<<<<<<<<<<<<< * phrase_len = phrase.n * extracts = [] */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_fphr_arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1489 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1495 * * fphr_arr = IntList() * phrase_len = phrase.n # <<<<<<<<<<<<<< @@ -54829,19 +57113,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_phrase->n; __pyx_v_phrase_len = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1490 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1496 * 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 = 1490; __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 = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_extracts = ((PyObject *)__pyx_t_1); + __pyx_v_extracts = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1491 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1497 * phrase_len = phrase.n * extracts = [] * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) # <<<<<<<<<<<<<< @@ -54850,7 +57134,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_sent_links = ((struct __pyx_vtabstruct_4cdec_2sa_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)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1493 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1499 * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<< @@ -54859,7 +57143,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_sent_start = (__pyx_v_self->eda->sent_index->arr[__pyx_v_matching->sent_id]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1494 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1500 * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] * e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<< @@ -54868,7 +57152,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_sent_end = (__pyx_v_self->eda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1495 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1501 * 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 # <<<<<<<<<<<<<< @@ -54877,7 +57161,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_sent_len = ((__pyx_v_e_sent_end - __pyx_v_e_sent_start) - 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1496 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1502 * 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] # <<<<<<<<<<<<<< @@ -54886,7 +57170,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_sent_start = (__pyx_v_self->fda->sent_index->arr[__pyx_v_matching->sent_id]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1497 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1503 * 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] # <<<<<<<<<<<<<< @@ -54895,7 +57179,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_sent_end = (__pyx_v_self->fda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1498 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1504 * 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 # <<<<<<<<<<<<<< @@ -54904,21 +57188,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_sent_len = ((__pyx_v_f_sent_end - __pyx_v_f_sent_start) - 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1500 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1506 * f_sent_len = f_sent_end - f_sent_start - 1 * * self.findexes1.reset() # <<<<<<<<<<<<<< * sofar = 0 * for i in range(num_chunks): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1506; __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 = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1506; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1501 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1507 * * self.findexes1.reset() * sofar = 0 # <<<<<<<<<<<<<< @@ -54928,7 +57212,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __Pyx_INCREF(__pyx_int_0); __pyx_v_sofar = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1502 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1508 * self.findexes1.reset() * sofar = 0 * for i in range(num_chunks): # <<<<<<<<<<<<<< @@ -54939,7 +57223,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1503 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1509 * sofar = 0 * for i in range(num_chunks): * for j in range(chunklen[i]): # <<<<<<<<<<<<<< @@ -54950,65 +57234,61 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1504 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1510 * 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_3 = 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_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1505 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1511 * 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 = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_sofar, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_sofar, __pyx_t_3); + __pyx_t_3 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1506 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1512 * self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); * sofar += 1 * if i+1 < num_chunks: # <<<<<<<<<<<<<< * self.findexes1.append(phrase[sofar]) * sofar += 1 */ - __pyx_t_7 = (((__pyx_v_i + 1) < __pyx_v_num_chunks) != 0); - if (__pyx_t_7) { + __pyx_t_8 = (((__pyx_v_i + 1) < __pyx_v_num_chunks) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1507 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1513 * 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 = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_phrase), __pyx_v_sofar); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1508 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1514 * if i+1 < num_chunks: * self.findexes1.append(phrase[sofar]) * sofar += 1 # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_sofar, __pyx_t_3); __pyx_t_3 = 0; @@ -55017,7 +57297,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L7:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1511 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1517 * * * e_links_low = malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -55026,7 +57306,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_links_low = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1512 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1518 * * e_links_low = malloc(e_sent_len*sizeof(int)) * e_links_high = malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -55035,7 +57315,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_links_high = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1513 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1519 * e_links_low = malloc(e_sent_len*sizeof(int)) * e_links_high = malloc(e_sent_len*sizeof(int)) * f_links_low = malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -55044,7 +57324,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_links_low = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1514 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1520 * e_links_high = malloc(e_sent_len*sizeof(int)) * f_links_low = malloc(f_sent_len*sizeof(int)) * f_links_high = malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -55053,7 +57333,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_links_high = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1515 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1521 * f_links_low = malloc(f_sent_len*sizeof(int)) * f_links_high = malloc(f_sent_len*sizeof(int)) * f_gap_low = malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -55062,7 +57342,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1516 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1522 * f_links_high = malloc(f_sent_len*sizeof(int)) * f_gap_low = malloc((num_chunks+1)*sizeof(int)) * f_gap_high = malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -55071,7 +57351,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1517 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1523 * f_gap_low = malloc((num_chunks+1)*sizeof(int)) * f_gap_high = malloc((num_chunks+1)*sizeof(int)) * e_gap_low = malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -55080,7 +57360,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1518 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1524 * f_gap_high = malloc((num_chunks+1)*sizeof(int)) * e_gap_low = malloc((num_chunks+1)*sizeof(int)) * e_gap_high = malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -55089,7 +57369,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1519 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1525 * e_gap_low = malloc((num_chunks+1)*sizeof(int)) * e_gap_high = malloc((num_chunks+1)*sizeof(int)) * memset(f_gap_low, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -55098,7 +57378,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ memset(__pyx_v_f_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1520 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1526 * e_gap_high = 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)) # <<<<<<<<<<<<<< @@ -55107,7 +57387,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ memset(__pyx_v_f_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1521 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1527 * 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)) # <<<<<<<<<<<<<< @@ -55116,7 +57396,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ memset(__pyx_v_e_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1522 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1528 * 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)) # <<<<<<<<<<<<<< @@ -55125,17 +57405,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ memset(__pyx_v_e_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1524 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1530 * memset(e_gap_high, 0, (num_chunks+1)*sizeof(int)) * * reason_for_failure = "" # <<<<<<<<<<<<<< * * for i from 0 <= i < e_sent_len: */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_47)); - __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_47); + __Pyx_INCREF(__pyx_kp_s__32); + __pyx_v_reason_for_failure = __pyx_kp_s__32; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1526 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1532 * reason_for_failure = "" * * for i from 0 <= i < e_sent_len: # <<<<<<<<<<<<<< @@ -55145,7 +57425,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_e_sent_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1527 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1533 * * for i from 0 <= i < e_sent_len: * e_links_low[i] = -1 # <<<<<<<<<<<<<< @@ -55154,7 +57434,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_e_links_low[__pyx_v_i]) = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1528 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1534 * for i from 0 <= i < e_sent_len: * e_links_low[i] = -1 * e_links_high[i] = -1 # <<<<<<<<<<<<<< @@ -55164,7 +57444,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct (__pyx_v_e_links_high[__pyx_v_i]) = -1; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1529 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1535 * e_links_low[i] = -1 * e_links_high[i] = -1 * for i from 0 <= i < f_sent_len: # <<<<<<<<<<<<<< @@ -55174,7 +57454,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_f_sent_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1530 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1536 * e_links_high[i] = -1 * for i from 0 <= i < f_sent_len: * f_links_low[i] = -1 # <<<<<<<<<<<<<< @@ -55183,7 +57463,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_f_links_low[__pyx_v_i]) = -1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1531 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1537 * for i from 0 <= i < f_sent_len: * f_links_low[i] = -1 * f_links_high[i] = -1 # <<<<<<<<<<<<<< @@ -55193,7 +57473,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct (__pyx_v_f_links_high[__pyx_v_i]) = -1; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1537 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1543 * # links that we care about (but then how to look up * # when we want to check something on the e side?) * i = 0 # <<<<<<<<<<<<<< @@ -55202,7 +57482,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1538 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1544 * # when we want to check something on the e side?) * i = 0 * while i < num_links*2: # <<<<<<<<<<<<<< @@ -55210,10 +57490,10 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * e_i = sent_links[i+1] */ while (1) { - __pyx_t_7 = ((__pyx_v_i < (__pyx_v_num_links * 2)) != 0); - if (!__pyx_t_7) break; + __pyx_t_8 = ((__pyx_v_i < (__pyx_v_num_links * 2)) != 0); + if (!__pyx_t_8) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1539 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1545 * i = 0 * while i < num_links*2: * f_i = sent_links[i] # <<<<<<<<<<<<<< @@ -55222,7 +57502,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_i = (__pyx_v_sent_links[__pyx_v_i]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1540 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1546 * while i < num_links*2: * f_i = sent_links[i] * e_i = sent_links[i+1] # <<<<<<<<<<<<<< @@ -55231,23 +57511,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_i = (__pyx_v_sent_links[(__pyx_v_i + 1)]); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1541 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1547 * 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: # <<<<<<<<<<<<<< * f_links_low[f_i] = e_i * if f_links_high[f_i] == -1 or f_links_high[f_i] < e_i + 1: */ - __pyx_t_7 = (((__pyx_v_f_links_low[__pyx_v_f_i]) == -1) != 0); - if (!__pyx_t_7) { - __pyx_t_8 = (((__pyx_v_f_links_low[__pyx_v_f_i]) > __pyx_v_e_i) != 0); - __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = (((__pyx_v_f_links_low[__pyx_v_f_i]) == -1) != 0); + if (!__pyx_t_8) { + __pyx_t_9 = (((__pyx_v_f_links_low[__pyx_v_f_i]) > __pyx_v_e_i) != 0); + __pyx_t_10 = __pyx_t_9; } else { - __pyx_t_9 = __pyx_t_7; + __pyx_t_10 = __pyx_t_8; } - if (__pyx_t_9) { + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1542 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1548 * 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 # <<<<<<<<<<<<<< @@ -55259,23 +57539,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L14:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1543 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1549 * 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: # <<<<<<<<<<<<<< * f_links_high[f_i] = e_i + 1 * if e_links_low[e_i] == -1 or e_links_low[e_i] > f_i: */ - __pyx_t_9 = (((__pyx_v_f_links_high[__pyx_v_f_i]) == -1) != 0); - if (!__pyx_t_9) { - __pyx_t_7 = (((__pyx_v_f_links_high[__pyx_v_f_i]) < (__pyx_v_e_i + 1)) != 0); - __pyx_t_8 = __pyx_t_7; + __pyx_t_10 = (((__pyx_v_f_links_high[__pyx_v_f_i]) == -1) != 0); + if (!__pyx_t_10) { + __pyx_t_8 = (((__pyx_v_f_links_high[__pyx_v_f_i]) < (__pyx_v_e_i + 1)) != 0); + __pyx_t_9 = __pyx_t_8; } else { - __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = __pyx_t_10; } - if (__pyx_t_8) { + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1544 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1550 * 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 # <<<<<<<<<<<<<< @@ -55287,23 +57567,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L15:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1545 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1551 * 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: # <<<<<<<<<<<<<< * e_links_low[e_i] = f_i * if e_links_high[e_i] == -1 or e_links_high[e_i] < f_i + 1: */ - __pyx_t_8 = (((__pyx_v_e_links_low[__pyx_v_e_i]) == -1) != 0); - if (!__pyx_t_8) { - __pyx_t_9 = (((__pyx_v_e_links_low[__pyx_v_e_i]) > __pyx_v_f_i) != 0); - __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = (((__pyx_v_e_links_low[__pyx_v_e_i]) == -1) != 0); + if (!__pyx_t_9) { + __pyx_t_10 = (((__pyx_v_e_links_low[__pyx_v_e_i]) > __pyx_v_f_i) != 0); + __pyx_t_8 = __pyx_t_10; } else { - __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = __pyx_t_9; } - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1546 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1552 * 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 # <<<<<<<<<<<<<< @@ -55315,23 +57595,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L16:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1547 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1553 * 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: # <<<<<<<<<<<<<< * e_links_high[e_i] = f_i + 1 * i = i + 2 */ - __pyx_t_7 = (((__pyx_v_e_links_high[__pyx_v_e_i]) == -1) != 0); - if (!__pyx_t_7) { - __pyx_t_8 = (((__pyx_v_e_links_high[__pyx_v_e_i]) < (__pyx_v_f_i + 1)) != 0); - __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = (((__pyx_v_e_links_high[__pyx_v_e_i]) == -1) != 0); + if (!__pyx_t_8) { + __pyx_t_9 = (((__pyx_v_e_links_high[__pyx_v_e_i]) < (__pyx_v_f_i + 1)) != 0); + __pyx_t_10 = __pyx_t_9; } else { - __pyx_t_9 = __pyx_t_7; + __pyx_t_10 = __pyx_t_8; } - if (__pyx_t_9) { + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1548 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1554 * 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 # <<<<<<<<<<<<<< @@ -55343,7 +57623,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L17:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1549 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1555 * 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 # <<<<<<<<<<<<<< @@ -55353,19 +57633,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_v_i = (__pyx_v_i + 2); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1551 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1557 * 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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1551; __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 = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_als = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1552 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1558 * * als = [] * for x in range(matching.start,matching.end): # <<<<<<<<<<<<<< @@ -55376,39 +57656,39 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct for (__pyx_t_4 = __pyx_v_matching->start; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { __pyx_v_x = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1553 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1559 * 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_3 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __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 = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int((__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 = 1559; __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 = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_al, ((PyObject*)__pyx_t_10)); - __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_al, ((PyObject*)__pyx_t_11)); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1554 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1560 * 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 = __Pyx_PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_als, __pyx_v_al); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1556 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1562 * als.append(al) * # check all source-side alignment constraints * met_constraints = 1 # <<<<<<<<<<<<<< @@ -55417,17 +57697,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1557 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1563 * # check all source-side alignment constraints * met_constraints = 1 * if self.require_aligned_terminal: # <<<<<<<<<<<<<< * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: */ - __pyx_t_9 = (__pyx_v_self->require_aligned_terminal != 0); - if (__pyx_t_9) { + __pyx_t_10 = (__pyx_v_self->require_aligned_terminal != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1558 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1564 * met_constraints = 1 * if self.require_aligned_terminal: * num_aligned_chunks = 0 # <<<<<<<<<<<<<< @@ -55436,7 +57716,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_num_aligned_chunks = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1559 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1565 * if self.require_aligned_terminal: * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: # <<<<<<<<<<<<<< @@ -55446,7 +57726,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_num_chunks; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1560 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1566 * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: * for j from 0 <= j < chunklen[i]: # <<<<<<<<<<<<<< @@ -55456,17 +57736,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_4 = (__pyx_v_chunklen[__pyx_v_i]); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1561 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1567 * 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: # <<<<<<<<<<<<<< * num_aligned_chunks = num_aligned_chunks + 1 * break */ - __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) != 0); - if (__pyx_t_9) { + __pyx_t_10 = (((__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) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1562 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1568 * 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 # <<<<<<<<<<<<<< @@ -55475,7 +57755,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_num_aligned_chunks = (__pyx_v_num_aligned_chunks + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1563 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1569 * if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1: * num_aligned_chunks = num_aligned_chunks + 1 * break # <<<<<<<<<<<<<< @@ -55483,34 +57763,32 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * reason_for_failure = "No aligned terminals" */ goto __pyx_L24_break; - goto __pyx_L25; } - __pyx_L25:; } __pyx_L24_break:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1564 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1570 * num_aligned_chunks = num_aligned_chunks + 1 * break * if num_aligned_chunks == 0: # <<<<<<<<<<<<<< * reason_for_failure = "No aligned terminals" * met_constraints = 0 */ - __pyx_t_9 = ((__pyx_v_num_aligned_chunks == 0) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_num_aligned_chunks == 0) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1565 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1571 * break * if num_aligned_chunks == 0: * reason_for_failure = "No aligned terminals" # <<<<<<<<<<<<<< * met_constraints = 0 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_133)); - __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_133)); + __Pyx_INCREF(__pyx_kp_s_No_aligned_terminals); + __Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_No_aligned_terminals); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1566 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1572 * if num_aligned_chunks == 0: * reason_for_failure = "No aligned terminals" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -55522,7 +57800,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L26:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1567 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1573 * reason_for_failure = "No aligned terminals" * met_constraints = 0 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: # <<<<<<<<<<<<<< @@ -55530,24 +57808,24 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * met_constraints = 0 */ if ((__pyx_v_self->require_aligned_chunks != 0)) { - __pyx_t_9 = ((__pyx_v_num_aligned_chunks < __pyx_v_num_chunks) != 0); - __pyx_t_7 = __pyx_t_9; + __pyx_t_10 = ((__pyx_v_num_aligned_chunks < __pyx_v_num_chunks) != 0); + __pyx_t_8 = __pyx_t_10; } else { - __pyx_t_7 = (__pyx_v_self->require_aligned_chunks != 0); + __pyx_t_8 = (__pyx_v_self->require_aligned_chunks != 0); } - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1568 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1574 * met_constraints = 0 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: * reason_for_failure = "Unaligned chunk" # <<<<<<<<<<<<<< * met_constraints = 0 * */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_134)); - __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_134)); + __Pyx_INCREF(__pyx_kp_s_Unaligned_chunk); + __Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_Unaligned_chunk); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1569 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1575 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: * reason_for_failure = "Unaligned chunk" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -55562,7 +57840,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L20:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1571 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1577 * met_constraints = 0 * * if met_constraints and self.tight_phrases: # <<<<<<<<<<<<<< @@ -55570,14 +57848,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * for i from 0 <= i < num_chunks-1: */ if ((__pyx_v_met_constraints != 0)) { - __pyx_t_7 = __pyx_v_self->tight_phrases; - __pyx_t_9 = __pyx_t_7; + __pyx_t_8 = __pyx_v_self->tight_phrases; + __pyx_t_10 = __pyx_t_8; } else { - __pyx_t_9 = (__pyx_v_met_constraints != 0); + __pyx_t_10 = (__pyx_v_met_constraints != 0); } - if (__pyx_t_9) { + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1573 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1579 * if met_constraints and self.tight_phrases: * # outside edge constraints are checked later * for i from 0 <= i < num_chunks-1: # <<<<<<<<<<<<<< @@ -55587,27 +57865,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_12 = (__pyx_v_num_chunks - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1574 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1580 * # 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: # <<<<<<<<<<<<<< * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 */ - __pyx_t_9 = (((__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) != 0); - if (__pyx_t_9) { + __pyx_t_10 = (((__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) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1575 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1581 * 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" # <<<<<<<<<<<<<< * met_constraints = 0 * break */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_135)); - __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_135)); + __Pyx_INCREF(__pyx_kp_s_Gaps_are_not_tight_phrases); + __Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_Gaps_are_not_tight_phrases); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1576 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1582 * 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 # <<<<<<<<<<<<<< @@ -55616,7 +57894,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1577 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1583 * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 * break # <<<<<<<<<<<<<< @@ -55624,31 +57902,29 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * reason_for_failure = "Gaps are not tight phrases" */ goto __pyx_L30_break; - goto __pyx_L31; } - __pyx_L31:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1578 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1584 * met_constraints = 0 * break * 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 */ - __pyx_t_9 = (((__pyx_v_f_links_low[(((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - 1) - __pyx_v_f_sent_start)]) == -1) != 0); - if (__pyx_t_9) { + __pyx_t_10 = (((__pyx_v_f_links_low[(((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - 1) - __pyx_v_f_sent_start)]) == -1) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1579 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1585 * break * 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 * break */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_135)); - __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_135)); + __Pyx_INCREF(__pyx_kp_s_Gaps_are_not_tight_phrases); + __Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_Gaps_are_not_tight_phrases); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1580 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1586 * 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 # <<<<<<<<<<<<<< @@ -55657,7 +57933,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1581 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1587 * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 * break # <<<<<<<<<<<<<< @@ -55665,16 +57941,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * f_low = matching.arr[matching.start] - f_sent_start */ goto __pyx_L30_break; - goto __pyx_L32; } - __pyx_L32:; } __pyx_L30_break:; goto __pyx_L28; } __pyx_L28:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1583 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1589 * break * * f_low = matching.arr[matching.start] - f_sent_start # <<<<<<<<<<<<<< @@ -55683,7 +57957,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_low = ((__pyx_v_matching->arr[__pyx_v_matching->start]) - __pyx_v_f_sent_start); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1584 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1590 * * 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 # <<<<<<<<<<<<<< @@ -55692,38 +57966,38 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1585 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1591 * 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: # <<<<<<<<<<<<<< * * if self.find_fixpoint(f_low, f_high, f_links_low, f_links_high, e_links_low, e_links_high, */ - __pyx_t_9 = (__pyx_v_met_constraints != 0); - if (__pyx_t_9) { + __pyx_t_10 = (__pyx_v_met_constraints != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1587 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1593 * 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 = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_f_high); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1591 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1597 * 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_9 = (((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9) { + __pyx_t_10 = (((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_low, __pyx_t_11, __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) != 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1592 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1598 * self.train_min_gap_size, 0, * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): * gap_error = 0 # <<<<<<<<<<<<<< @@ -55732,7 +58006,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_error = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1593 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1599 * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): * gap_error = 0 * num_gaps = 0 # <<<<<<<<<<<<<< @@ -55741,17 +58015,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_num_gaps = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1595 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1601 * num_gaps = 0 * * if f_back_low < f_low: # <<<<<<<<<<<<<< * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low */ - __pyx_t_9 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1596 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1602 * * if f_back_low < f_low: * f_gap_low[0] = f_back_low # <<<<<<<<<<<<<< @@ -55760,7 +58034,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_f_gap_low[0]) = __pyx_v_f_back_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1597 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1603 * if f_back_low < f_low: * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low # <<<<<<<<<<<<<< @@ -55769,7 +58043,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_f_gap_high[0]) = __pyx_v_f_low; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1598 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1604 * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low * num_gaps = 1 # <<<<<<<<<<<<<< @@ -55778,7 +58052,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_num_gaps = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1599 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1605 * f_gap_high[0] = f_low * num_gaps = 1 * gap_start = 0 # <<<<<<<<<<<<<< @@ -55787,7 +58061,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_start = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1600 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1606 * num_gaps = 1 * gap_start = 0 * phrase_len = phrase_len+1 # <<<<<<<<<<<<<< @@ -55796,17 +58070,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_phrase_len = (__pyx_v_phrase_len + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1601 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1607 * gap_start = 0 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: # <<<<<<<<<<<<<< * gap_error = 1 * if self.tight_phrases: */ - __pyx_t_9 = ((__pyx_v_phrase_len > __pyx_v_self->max_length) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_phrase_len > __pyx_v_self->max_length) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1602 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1608 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: * gap_error = 1 # <<<<<<<<<<<<<< @@ -55818,33 +58092,33 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L36:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1603 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1609 * if phrase_len > self.max_length: * gap_error = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: * gap_error = 1 */ - __pyx_t_9 = (__pyx_v_self->tight_phrases != 0); - if (__pyx_t_9) { + __pyx_t_10 = (__pyx_v_self->tight_phrases != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1604 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1610 * gap_error = 1 * if self.tight_phrases: * 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" */ - __pyx_t_9 = (((__pyx_v_f_links_low[__pyx_v_f_back_low]) == -1) != 0); - if (!__pyx_t_9) { - __pyx_t_7 = (((__pyx_v_f_links_low[(__pyx_v_f_low - 1)]) == -1) != 0); - __pyx_t_8 = __pyx_t_7; + __pyx_t_10 = (((__pyx_v_f_links_low[__pyx_v_f_back_low]) == -1) != 0); + if (!__pyx_t_10) { + __pyx_t_8 = (((__pyx_v_f_links_low[(__pyx_v_f_low - 1)]) == -1) != 0); + __pyx_t_9 = __pyx_t_8; } else { - __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = __pyx_t_10; } - if (__pyx_t_8) { + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1605 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1611 * if self.tight_phrases: * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: * gap_error = 1 # <<<<<<<<<<<<<< @@ -55853,15 +58127,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_error = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1606 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1612 * 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" # <<<<<<<<<<<<<< * else: * gap_start = 1 */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_136)); - __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_136)); + __Pyx_INCREF(__pyx_kp_s_Inside_edges_of_preceding_subphr); + __Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_Inside_edges_of_preceding_subphr); goto __pyx_L38; } __pyx_L38:; @@ -55872,7 +58146,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1608 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1614 * reason_for_failure = "Inside edges of preceding subphrase are not tight" * else: * gap_start = 1 # <<<<<<<<<<<<<< @@ -55881,7 +58155,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_start = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1609 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1615 * else: * gap_start = 1 * if self.tight_phrases and f_links_low[f_low] == -1: # <<<<<<<<<<<<<< @@ -55889,14 +58163,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * # but we still might be able to extract a superphrase */ if ((__pyx_v_self->tight_phrases != 0)) { - __pyx_t_8 = (((__pyx_v_f_links_low[__pyx_v_f_low]) == -1) != 0); - __pyx_t_9 = __pyx_t_8; + __pyx_t_9 = (((__pyx_v_f_links_low[__pyx_v_f_low]) == -1) != 0); + __pyx_t_10 = __pyx_t_9; } else { - __pyx_t_9 = (__pyx_v_self->tight_phrases != 0); + __pyx_t_10 = (__pyx_v_self->tight_phrases != 0); } - if (__pyx_t_9) { + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1612 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1618 * # 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 # <<<<<<<<<<<<<< @@ -55910,7 +58184,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L35:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1614 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1620 * met_constraints = 0 * * for i from 0 <= i < matching.size - 1: # <<<<<<<<<<<<<< @@ -55920,7 +58194,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_12 = (__pyx_v_matching->size - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1615 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1621 * * for i from 0 <= i < matching.size - 1: * f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start # <<<<<<<<<<<<<< @@ -55929,7 +58203,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1616 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1622 * 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 # <<<<<<<<<<<<<< @@ -55938,7 +58212,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__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); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1617 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1623 * 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 # <<<<<<<<<<<<<< @@ -55948,17 +58222,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_v_num_gaps = (__pyx_v_num_gaps + 1); } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1619 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1625 * num_gaps = num_gaps + 1 * * 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 */ - __pyx_t_9 = ((__pyx_v_f_high < __pyx_v_f_back_high) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_f_high < __pyx_v_f_back_high) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1620 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1626 * * if f_high < f_back_high: * f_gap_low[gap_start+num_gaps] = f_high # <<<<<<<<<<<<<< @@ -55967,7 +58241,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1621 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1627 * 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 # <<<<<<<<<<<<<< @@ -55976,7 +58250,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ (__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_back_high; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1622 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1628 * f_gap_low[gap_start+num_gaps] = f_high * f_gap_high[gap_start+num_gaps] = f_back_high * num_gaps = num_gaps + 1 # <<<<<<<<<<<<<< @@ -55985,7 +58259,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_num_gaps = (__pyx_v_num_gaps + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1623 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1629 * f_gap_high[gap_start+num_gaps] = f_back_high * num_gaps = num_gaps + 1 * phrase_len = phrase_len+1 # <<<<<<<<<<<<<< @@ -55994,17 +58268,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_phrase_len = (__pyx_v_phrase_len + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1624 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1630 * num_gaps = num_gaps + 1 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: # <<<<<<<<<<<<<< * gap_error = 1 * if self.tight_phrases: */ - __pyx_t_9 = ((__pyx_v_phrase_len > __pyx_v_self->max_length) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_phrase_len > __pyx_v_self->max_length) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1625 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1631 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: * gap_error = 1 # <<<<<<<<<<<<<< @@ -56016,33 +58290,33 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L43:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1626 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1632 * if phrase_len > self.max_length: * gap_error = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: * gap_error = 1 */ - __pyx_t_9 = (__pyx_v_self->tight_phrases != 0); - if (__pyx_t_9) { + __pyx_t_10 = (__pyx_v_self->tight_phrases != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1627 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1633 * gap_error = 1 * if self.tight_phrases: * 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" */ - __pyx_t_9 = (((__pyx_v_f_links_low[(__pyx_v_f_back_high - 1)]) == -1) != 0); - if (!__pyx_t_9) { - __pyx_t_8 = (((__pyx_v_f_links_low[__pyx_v_f_high]) == -1) != 0); - __pyx_t_7 = __pyx_t_8; + __pyx_t_10 = (((__pyx_v_f_links_low[(__pyx_v_f_back_high - 1)]) == -1) != 0); + if (!__pyx_t_10) { + __pyx_t_9 = (((__pyx_v_f_links_low[__pyx_v_f_high]) == -1) != 0); + __pyx_t_8 = __pyx_t_9; } else { - __pyx_t_7 = __pyx_t_9; + __pyx_t_8 = __pyx_t_10; } - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1628 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1634 * if self.tight_phrases: * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: * gap_error = 1 # <<<<<<<<<<<<<< @@ -56051,15 +58325,15 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_error = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1629 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1635 * 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" # <<<<<<<<<<<<<< * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_137)); - __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_137)); + __Pyx_INCREF(__pyx_kp_s_Inside_edges_of_following_subphr); + __Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_Inside_edges_of_following_subphr); goto __pyx_L45; } __pyx_L45:; @@ -56070,7 +58344,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1631 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1637 * reason_for_failure = "Inside edges of following subphrase are not tight" * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: # <<<<<<<<<<<<<< @@ -56078,14 +58352,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * */ if ((__pyx_v_self->tight_phrases != 0)) { - __pyx_t_7 = (((__pyx_v_f_links_low[(__pyx_v_f_high - 1)]) == -1) != 0); - __pyx_t_9 = __pyx_t_7; + __pyx_t_8 = (((__pyx_v_f_links_low[(__pyx_v_f_high - 1)]) == -1) != 0); + __pyx_t_10 = __pyx_t_8; } else { - __pyx_t_9 = (__pyx_v_self->tight_phrases != 0); + __pyx_t_10 = (__pyx_v_self->tight_phrases != 0); } - if (__pyx_t_9) { + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1632 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1638 * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -56099,17 +58373,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L42:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1634 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1640 * met_constraints = 0 * * if gap_error == 0: # <<<<<<<<<<<<<< * e_word_count = e_high - e_low * for i from 0 <= i < num_gaps: # check integrity of subphrases */ - __pyx_t_9 = ((__pyx_v_gap_error == 0) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_gap_error == 0) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1635 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1641 * * if gap_error == 0: * e_word_count = e_high - e_low # <<<<<<<<<<<<<< @@ -56118,7 +58392,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_e_word_count = (__pyx_v_e_high - __pyx_v_e_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1636 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1642 * if gap_error == 0: * e_word_count = e_high - e_low * for i from 0 <= i < num_gaps: # check integrity of subphrases # <<<<<<<<<<<<<< @@ -56128,28 +58402,28 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_num_gaps; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1637 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1643 * 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 = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyInt_From_int((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1642 - * f_gap_low+gap_start+i, f_gap_high+gap_start+i, + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1649 * f_sent_len, e_sent_len, - * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< - * 0, 0, 0, 0, 0, 0, 0) == 0: + * self.train_max_initial_size, self.train_max_initial_size, + * 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]) */ - __pyx_t_9 = ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9) { + __pyx_t_10 = ((((struct __pyx_vtabstruct_4cdec_2sa_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_11, __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) != 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1644 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1650 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0) == 0: * gap_error = 1 # <<<<<<<<<<<<<< @@ -56158,32 +58432,32 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_gap_error = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1645 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1651 * 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 = 1645; __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 = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_From_int((__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1651; __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, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_10 = 0; + __pyx_t_11 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_138), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_t_1)); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Subphrase_d_d_failed_integrity_c, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1646 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1652 * 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 # <<<<<<<<<<<<<< @@ -56191,26 +58465,24 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * if gap_error == 0: */ goto __pyx_L49_break; - goto __pyx_L50; } - __pyx_L50:; } __pyx_L49_break:; goto __pyx_L47; } __pyx_L47:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1648 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1654 * break * * if gap_error == 0: # <<<<<<<<<<<<<< * i = 1 * self.findexes.reset() */ - __pyx_t_9 = ((__pyx_v_gap_error == 0) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_gap_error == 0) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1649 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1655 * * if gap_error == 0: * i = 1 # <<<<<<<<<<<<<< @@ -56219,31 +58491,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1650 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1656 * 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1656; __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 = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1656; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1651 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1657 * i = 1 * self.findexes.reset() * if f_back_low < f_low: # <<<<<<<<<<<<<< * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 */ - __pyx_t_9 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1652 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1658 * self.findexes.reset() * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56252,7 +58524,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1653 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1659 * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -56261,44 +58533,42 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1654 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1660 * 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_3 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_3); 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_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L52; } __pyx_L52:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1655 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1661 * 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __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[8]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1)); - PyTuple_SET_ITEM(__pyx_t_3, 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_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1656 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1662 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -56308,17 +58578,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1657 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1663 * 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_9 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); - if (__pyx_t_9) { + __pyx_t_10 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1658 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1664 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56327,7 +58597,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1659 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1665 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -56339,7 +58609,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1661 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1667 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -56351,17 +58621,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L55:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1662 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1668 * else: * 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)) */ - __pyx_t_9 = ((__pyx_v_f_back_high > __pyx_v_f_high) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_f_back_high > __pyx_v_f_high) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1663 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1669 * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56370,98 +58640,96 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1664 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1670 * 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_10 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_11); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L56; } __pyx_L56:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1666 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1672 * 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_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_fphr_arr)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_fphr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr)); - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_v_fphr = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_10); - __pyx_t_10 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_fphr = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1667 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1673 * * 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, * f_back_low, f_back_high, f_gap_low + gap_start, f_gap_high + gap_start, f_links_low, */ - __pyx_t_9 = (__pyx_v_met_constraints != 0); - if (__pyx_t_9) { + __pyx_t_10 = (__pyx_v_met_constraints != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1670 - * phrase_list = self.extract_phrases(e_low, e_high, e_gap_low + gap_start, e_gap_high + gap_start, e_links_low, num_gaps, + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1674 + * 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, # <<<<<<<<<<<<<< * 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) + * matching.sent_id, e_sent_len, e_sent_start) */ - __pyx_t_10 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_v_phrase_list = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_4cdec_2sa_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_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_phrase_list = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1671 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1677 * 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 = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = ((__pyx_t_13 > 0) != 0); - if (__pyx_t_9) { + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((__pyx_t_13 > 0) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1672 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1678 * 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 = 1672; __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 = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L58; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1674 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1680 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -56470,44 +58738,44 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_pair_count = 0.0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1675 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1681 * 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_10 = PyInt_FromLong(__pyx_v_f_back_low); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyInt_FromLong(__pyx_v_e_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_f_back_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = PyInt_FromLong(__pyx_v_e_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_f_back_high); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_e_low); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_e_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1681; __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 = 1675; __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 = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); - __pyx_t_10 = 0; - __pyx_t_3 = 0; __pyx_t_1 = 0; + __pyx_t_11 = 0; + __pyx_t_3 = 0; __pyx_t_14 = 0; - __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_139), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __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_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_t_14)); + __pyx_t_14 = __Pyx_PyString_Format(__pyx_kp_s_Didn_t_extract_anything_from_d_d, __pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_t_14); __pyx_t_14 = 0; } __pyx_L58:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1676 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1682 * 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: # <<<<<<<<<<<<<< @@ -56518,7 +58786,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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 = 1676; __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 = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; } @@ -56526,23 +58794,24 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1682; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1682; __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 = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -56558,53 +58827,52 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } else - { + } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __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_t_1 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L61_unpacking_failed; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_17(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L61_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + index = 1; __pyx_t_11 = __pyx_t_17(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L61_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_17 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L62_unpacking_done; __pyx_L61_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_17 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L62_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_1); - __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_11); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1677 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1683 * 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) # <<<<<<<<<<<<<< @@ -56613,31 +58881,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_t_15 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_15); - if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_XDECREF_SET(__pyx_v_als1, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3)); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_als1, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_11)); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1678 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1684 * 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 * phrase_len < self.max_length and */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_15 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_v_als1)); PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_als1)); __Pyx_GIVEREF(((PyObject *)__pyx_v_als1)); - __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 = 1678; __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 = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__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 = 1684; __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)); @@ -56645,81 +58913,79 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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_3); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_11 = 0; __pyx_t_3 = 0; - __pyx_t_1 = 0; - __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 = 1678; __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_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_extracts, __pyx_t_15); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L57; } __pyx_L57:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1679 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1685 * 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 # <<<<<<<<<<<<<< * phrase_len < self.max_length and * f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size): */ - __pyx_t_9 = ((__pyx_v_num_gaps < __pyx_v_self->max_nonterminals) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_num_gaps < __pyx_v_self->max_nonterminals) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1680 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1686 * extracts.append((fphr, phrase2, pair_count, tuple(als1))) * 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): * if (f_back_low == f_low and */ - __pyx_t_7 = ((__pyx_v_phrase_len < __pyx_v_self->max_length) != 0); - if (__pyx_t_7) { + __pyx_t_8 = ((__pyx_v_phrase_len < __pyx_v_self->max_length) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1681 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1687 * 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): # <<<<<<<<<<<<<< * if (f_back_low == f_low and * f_low >= self.train_min_gap_size and */ - __pyx_t_8 = ((((__pyx_v_f_back_high - __pyx_v_f_back_low) + __pyx_v_self->train_min_gap_size) <= __pyx_v_self->train_max_initial_size) != 0); - __pyx_t_18 = __pyx_t_8; + __pyx_t_9 = ((((__pyx_v_f_back_high - __pyx_v_f_back_low) + __pyx_v_self->train_min_gap_size) <= __pyx_v_self->train_max_initial_size) != 0); + __pyx_t_18 = __pyx_t_9; } else { - __pyx_t_18 = __pyx_t_7; + __pyx_t_18 = __pyx_t_8; } - __pyx_t_7 = __pyx_t_18; + __pyx_t_8 = __pyx_t_18; } else { - __pyx_t_7 = __pyx_t_9; + __pyx_t_8 = __pyx_t_10; } - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1682 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1688 * 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 # <<<<<<<<<<<<<< * 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))): */ - __pyx_t_7 = ((__pyx_v_f_back_low == __pyx_v_f_low) != 0); - if (__pyx_t_7) { + __pyx_t_8 = ((__pyx_v_f_back_low == __pyx_v_f_low) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1683 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1689 * 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 # <<<<<<<<<<<<<< * ((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 */ - __pyx_t_9 = ((__pyx_v_f_low >= __pyx_v_self->train_min_gap_size) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_f_low >= __pyx_v_self->train_min_gap_size) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1684 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1690 * 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))): # <<<<<<<<<<<<<< @@ -56728,28 +58994,28 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_t_18 = ((!(__pyx_v_self->tight_phrases != 0)) != 0); if (!__pyx_t_18) { - __pyx_t_8 = (((__pyx_v_f_links_low[(__pyx_v_f_low - 1)]) != -1) != 0); - if (__pyx_t_8) { + __pyx_t_9 = (((__pyx_v_f_links_low[(__pyx_v_f_low - 1)]) != -1) != 0); + if (__pyx_t_9) { __pyx_t_19 = (((__pyx_v_f_links_low[(__pyx_v_f_back_high - 1)]) != -1) != 0); __pyx_t_20 = __pyx_t_19; } else { - __pyx_t_20 = __pyx_t_8; + __pyx_t_20 = __pyx_t_9; } - __pyx_t_8 = __pyx_t_20; + __pyx_t_9 = __pyx_t_20; } else { - __pyx_t_8 = __pyx_t_18; + __pyx_t_9 = __pyx_t_18; } - __pyx_t_18 = __pyx_t_8; - } else { __pyx_t_18 = __pyx_t_9; + } else { + __pyx_t_18 = __pyx_t_10; } - __pyx_t_9 = __pyx_t_18; + __pyx_t_10 = __pyx_t_18; } else { - __pyx_t_9 = __pyx_t_7; + __pyx_t_10 = __pyx_t_8; } - if (__pyx_t_9) { + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1685 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1691 * 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 # <<<<<<<<<<<<<< @@ -56758,7 +59024,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1686 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1692 * ((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 # <<<<<<<<<<<<<< @@ -56767,17 +59033,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1687 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1693 * f_x_low = f_low-self.train_min_gap_size * met_constraints = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 */ - __pyx_t_9 = (__pyx_v_self->tight_phrases != 0); - if (__pyx_t_9) { + __pyx_t_10 = (__pyx_v_self->tight_phrases != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1688 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1694 * met_constraints = 1 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<< @@ -56785,16 +59051,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * if f_x_low < 0 or f_back_high - f_x_low > self.train_max_initial_size: */ while (1) { - __pyx_t_9 = ((__pyx_v_f_x_low >= 0) != 0); - if (__pyx_t_9) { - __pyx_t_7 = (((__pyx_v_f_links_low[__pyx_v_f_x_low]) == -1) != 0); - __pyx_t_18 = __pyx_t_7; + __pyx_t_10 = ((__pyx_v_f_x_low >= 0) != 0); + if (__pyx_t_10) { + __pyx_t_8 = (((__pyx_v_f_links_low[__pyx_v_f_x_low]) == -1) != 0); + __pyx_t_18 = __pyx_t_8; } else { - __pyx_t_18 = __pyx_t_9; + __pyx_t_18 = __pyx_t_10; } if (!__pyx_t_18) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1689 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1695 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 # <<<<<<<<<<<<<< @@ -56807,7 +59073,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L65:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1690 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1696 * 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: # <<<<<<<<<<<<<< @@ -56816,14 +59082,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_t_18 = ((__pyx_v_f_x_low < 0) != 0); if (!__pyx_t_18) { - __pyx_t_9 = (((__pyx_v_f_back_high - __pyx_v_f_x_low) > __pyx_v_self->train_max_initial_size) != 0); - __pyx_t_7 = __pyx_t_9; + __pyx_t_10 = (((__pyx_v_f_back_high - __pyx_v_f_x_low) > __pyx_v_self->train_max_initial_size) != 0); + __pyx_t_8 = __pyx_t_10; } else { - __pyx_t_7 = __pyx_t_18; + __pyx_t_8 = __pyx_t_18; } - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1691 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1697 * 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 # <<<<<<<<<<<<<< @@ -56835,7 +59101,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L68:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1693 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1699 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -56844,28 +59110,28 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ if ((__pyx_v_met_constraints != 0)) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1694 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1700 * * 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 = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_f_back_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1698 - * e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high, + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1705 * f_sent_len, e_sent_len, - * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< - * 1, 1, 1, 1, 0, 1, 0) == 1) and + * self.train_max_initial_size, self.train_max_initial_size, + * 1, 1, 1, 1, 0, 1, 0) == 1) 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 */ - __pyx_t_7 = (((struct __pyx_vtabstruct_4cdec_2sa_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) == 1); + __pyx_t_8 = (((struct __pyx_vtabstruct_4cdec_2sa_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) == 1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1700 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1706 * self.train_max_initial_size, self.train_max_initial_size, * 1, 1, 1, 1, 0, 1, 0) == 1) and * ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and # <<<<<<<<<<<<<< @@ -56874,24 +59140,24 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_t_18 = (!(__pyx_v_self->tight_phrases != 0)); if (!__pyx_t_18) { - __pyx_t_9 = ((__pyx_v_f_links_low[__pyx_v_f_x_low]) != -1); - __pyx_t_8 = __pyx_t_9; + __pyx_t_10 = ((__pyx_v_f_links_low[__pyx_v_f_x_low]) != -1); + __pyx_t_9 = __pyx_t_10; } else { - __pyx_t_8 = __pyx_t_18; + __pyx_t_9 = __pyx_t_18; } - if (__pyx_t_8) { + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1701 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1707 * 1, 1, 1, 1, 0, 1, 0) == 1) 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_14 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_f_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1705 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1711 * -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, # <<<<<<<<<<<<<< @@ -56901,19 +59167,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_18 = (((struct __pyx_vtabstruct_4cdec_2sa_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, -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) != 0); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else { - __pyx_t_18 = __pyx_t_8; + __pyx_t_18 = __pyx_t_9; } - __pyx_t_8 = __pyx_t_18; + __pyx_t_9 = __pyx_t_18; } else { - __pyx_t_8 = __pyx_t_7; + __pyx_t_9 = __pyx_t_8; } - __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = __pyx_t_9; } else { - __pyx_t_7 = (__pyx_v_met_constraints != 0); + __pyx_t_8 = (__pyx_v_met_constraints != 0); } - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1707 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1713 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -56922,7 +59188,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1708 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1714 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -56931,35 +59197,33 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1709 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1715 * 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s_reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __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 = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1715; __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_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1710 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1716 * 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_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1710; __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 = 1710; __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; + __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1711 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1717 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56968,7 +59232,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1712 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1718 * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -56977,27 +59241,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1713 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1719 * 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s_extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1719; __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 = 1719; __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 = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1)); - PyTuple_SET_ITEM(__pyx_t_1, 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_15 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1713; __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_1)); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1714 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1720 * i = i+1 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -57007,17 +59271,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1715 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1721 * 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_7 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); - if (__pyx_t_7) { + __pyx_t_8 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1716 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1722 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57026,7 +59290,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1717 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1723 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -57038,7 +59302,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1719 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1725 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -57050,17 +59314,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L72:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1720 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1726 * else: * 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)) */ - __pyx_t_7 = ((__pyx_v_f_back_high > __pyx_v_f_high) != 0); - if (__pyx_t_7) { + __pyx_t_8 = ((__pyx_v_f_back_high > __pyx_v_f_high) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1721 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1727 * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57069,88 +59333,86 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1722 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1728 * 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_15 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1722; __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 = 1722; __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; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L73; } __pyx_L73:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1723 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1729 * 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_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __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[8]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_fphr_arr)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_fphr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr)); - __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_15)); - __pyx_t_15 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_14)); + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1726 - * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1, + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1730 + * 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, - * e_sent_len, e_sent_start) # <<<<<<<<<<<<<< - * if len(phrase_list) > 0: - * pair_count = 1.0 / len(phrase_list) + * e_sent_len, e_sent_start) */ - __pyx_t_15 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_15); - __pyx_t_15 = 0; + __pyx_t_14 = ((struct __pyx_vtabstruct_4cdec_2sa_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_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_14); + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1727 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1733 * 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 = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = ((__pyx_t_13 > 0) != 0); - if (__pyx_t_7) { + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((__pyx_t_13 > 0) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1728 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1734 * 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 = 1728; __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 = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L74; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1730 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1736 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -57161,7 +59423,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L74:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1731 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1737 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -57169,41 +59431,42 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * extracts.append((fphr, phrase2, pair_count, tuple(als2))) */ 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_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_15 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __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_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __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_15)) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_15)) break; + 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_1 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __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; + } 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_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __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 = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_16(__pyx_t_14); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; + 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 @@ -57212,105 +59475,102 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_14 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_15 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else - { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __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_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L77_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_15 = __pyx_t_17(__pyx_t_1); if (unlikely(!__pyx_t_15)) goto __pyx_L77_unpacking_failed; + __Pyx_GOTREF(__pyx_t_15); + index = 1; __pyx_t_11 = __pyx_t_17(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L77_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_17 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L78_unpacking_done; __pyx_L77_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_17 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L78_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_14); - __pyx_t_14 = 0; - __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_15); + __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_11); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1732 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1738 * 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_1 = ((PyObject *)__pyx_v_self->findexes); - __Pyx_INCREF(__pyx_t_1); - if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_als2, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3)); - __pyx_t_3 = 0; + __pyx_t_3 = ((PyObject *)__pyx_v_self->findexes); + __Pyx_INCREF(__pyx_t_3); + if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_als2, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_11)); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1733 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1739 * 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_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_als2)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_als2)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_als2)); __Pyx_GIVEREF(((PyObject *)__pyx_v_als2)); - __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 = 1733; __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 = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_fphr)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_fphr)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_fphr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr)); __Pyx_INCREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_phrase2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_phrase2); __Pyx_GIVEREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_14); - __Pyx_GIVEREF(__pyx_t_14); - __pyx_t_3 = 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 = 1733; __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; + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __pyx_t_11 = 0; + __pyx_t_15 = 0; + __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_extracts, __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L69; } __pyx_L69:; @@ -57318,27 +59578,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L64:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1735 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1741 * extracts.append((fphr, phrase2, pair_count, tuple(als2))) * * 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))): */ - __pyx_t_7 = ((__pyx_v_f_back_high == __pyx_v_f_high) != 0); - if (__pyx_t_7) { + __pyx_t_8 = ((__pyx_v_f_back_high == __pyx_v_f_high) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1736 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1742 * * 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))): * f_x_high = f_high+self.train_min_gap_size */ - __pyx_t_8 = (((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size) != 0); - if (__pyx_t_8) { + __pyx_t_9 = (((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size) != 0); + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1737 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1743 * 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))): # <<<<<<<<<<<<<< @@ -57347,28 +59607,28 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_t_18 = ((!(__pyx_v_self->tight_phrases != 0)) != 0); if (!__pyx_t_18) { - __pyx_t_9 = (((__pyx_v_f_links_low[__pyx_v_f_high]) != -1) != 0); - if (__pyx_t_9) { + __pyx_t_10 = (((__pyx_v_f_links_low[__pyx_v_f_high]) != -1) != 0); + if (__pyx_t_10) { __pyx_t_20 = (((__pyx_v_f_links_low[__pyx_v_f_back_low]) != -1) != 0); __pyx_t_19 = __pyx_t_20; } else { - __pyx_t_19 = __pyx_t_9; + __pyx_t_19 = __pyx_t_10; } - __pyx_t_9 = __pyx_t_19; + __pyx_t_10 = __pyx_t_19; } else { - __pyx_t_9 = __pyx_t_18; + __pyx_t_10 = __pyx_t_18; } - __pyx_t_18 = __pyx_t_9; + __pyx_t_18 = __pyx_t_10; } else { - __pyx_t_18 = __pyx_t_8; + __pyx_t_18 = __pyx_t_9; } - __pyx_t_8 = __pyx_t_18; + __pyx_t_9 = __pyx_t_18; } else { - __pyx_t_8 = __pyx_t_7; + __pyx_t_9 = __pyx_t_8; } - if (__pyx_t_8) { + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1738 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1744 * 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 # <<<<<<<<<<<<<< @@ -57377,7 +59637,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1739 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1745 * ((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 # <<<<<<<<<<<<<< @@ -57386,17 +59646,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1740 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1746 * f_x_high = f_high+self.train_min_gap_size * met_constraints = 1 * 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 */ - __pyx_t_8 = (__pyx_v_self->tight_phrases != 0); - if (__pyx_t_8) { + __pyx_t_9 = (__pyx_v_self->tight_phrases != 0); + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1741 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1747 * met_constraints = 1 * if self.tight_phrases: * while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<< @@ -57404,16 +59664,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * if f_x_high > f_sent_len or f_x_high - f_back_low > self.train_max_initial_size: */ while (1) { - __pyx_t_8 = ((__pyx_v_f_x_high <= __pyx_v_f_sent_len) != 0); - if (__pyx_t_8) { - __pyx_t_7 = (((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) == -1) != 0); - __pyx_t_18 = __pyx_t_7; - } else { + __pyx_t_9 = ((__pyx_v_f_x_high <= __pyx_v_f_sent_len) != 0); + if (__pyx_t_9) { + __pyx_t_8 = (((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) == -1) != 0); __pyx_t_18 = __pyx_t_8; + } else { + __pyx_t_18 = __pyx_t_9; } if (!__pyx_t_18) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1742 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1748 * 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 # <<<<<<<<<<<<<< @@ -57426,7 +59686,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L80:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1743 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1749 * 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: # <<<<<<<<<<<<<< @@ -57435,14 +59695,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_t_18 = ((__pyx_v_f_x_high > __pyx_v_f_sent_len) != 0); if (!__pyx_t_18) { - __pyx_t_8 = (((__pyx_v_f_x_high - __pyx_v_f_back_low) > __pyx_v_self->train_max_initial_size) != 0); - __pyx_t_7 = __pyx_t_8; + __pyx_t_9 = (((__pyx_v_f_x_high - __pyx_v_f_back_low) > __pyx_v_self->train_max_initial_size) != 0); + __pyx_t_8 = __pyx_t_9; } else { - __pyx_t_7 = __pyx_t_18; + __pyx_t_8 = __pyx_t_18; } - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1744 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1750 * 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 # <<<<<<<<<<<<<< @@ -57454,7 +59714,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L83:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1746 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1752 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -57463,76 +59723,76 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ if ((__pyx_v_met_constraints != 0)) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1747 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1753 * * 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_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); + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1751 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1757 * 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_4cdec_2sa_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) != 0)) { - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_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, 0, 1, 1, 0) != 0)) { + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1753 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1759 * 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 # <<<<<<<<<<<<<< * self.find_fixpoint(f_high, f_x_high, * f_links_low, f_links_high, e_links_low, e_links_high, */ - __pyx_t_7 = (!(__pyx_v_self->tight_phrases != 0)); - if (!__pyx_t_7) { + __pyx_t_8 = (!(__pyx_v_self->tight_phrases != 0)); + if (!__pyx_t_8) { __pyx_t_18 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) != -1); - __pyx_t_8 = __pyx_t_18; + __pyx_t_9 = __pyx_t_18; } else { - __pyx_t_8 = __pyx_t_7; + __pyx_t_9 = __pyx_t_8; } - if (__pyx_t_8) { + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1754 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1760 * 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_14 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_f_x_high); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1759 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1765 * 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_7 = (((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_8 = (((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_high, __pyx_t_3, __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) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = __pyx_t_9; } - __pyx_t_8 = __pyx_t_7; + __pyx_t_9 = __pyx_t_8; } else { - __pyx_t_8 = (((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_9 = (((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_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, 0, 1, 1, 0) != 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = __pyx_t_9; } else { - __pyx_t_7 = (__pyx_v_met_constraints != 0); + __pyx_t_8 = (__pyx_v_met_constraints != 0); } - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1761 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1767 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -57541,7 +59801,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1762 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1768 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -57550,31 +59810,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1763 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1769 * fphr_arr._clear() * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); 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); - __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 = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s_reset); 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(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1764 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1770 * i = 1 * self.findexes.reset() * if f_back_low < f_low: # <<<<<<<<<<<<<< * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 */ - __pyx_t_7 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0); - if (__pyx_t_7) { + __pyx_t_8 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1765 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1771 * self.findexes.reset() * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57583,7 +59843,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1766 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1772 * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -57592,44 +59852,42 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1767 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1773 * 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_14 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __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 = 1767; __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; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L85; } __pyx_L85:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1768 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1774 * 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_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); 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_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1774; __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 = 1774; __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)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1)); - __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 = 1768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __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; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1769 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1775 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -57639,17 +59897,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1770 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1776 * 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_7 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); - if (__pyx_t_7) { + __pyx_t_8 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1771 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1777 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57658,7 +59916,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1772 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1778 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -57670,7 +59928,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1774 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1780 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -57682,7 +59940,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L88:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1775 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1781 * else: * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57691,85 +59949,83 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1776 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1782 * 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_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1776; __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 = 1776; __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; + __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1777 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1783 * 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_14 = PyTuple_New(1); 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_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr)); - PyTuple_SET_ITEM(__pyx_t_14, 0, ((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_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1)); - __pyx_t_1 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_15, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_14)); + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1780 - * 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, + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1784 + * 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, - * matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<< - * if len(phrase_list) > 0: - * pair_count = 1.0 / len(phrase_list) + * matching.sent_id, e_sent_len, e_sent_start) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_14 = ((struct __pyx_vtabstruct_4cdec_2sa_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_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_14); + __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1781 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1787 * 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 = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = ((__pyx_t_13 > 0) != 0); - if (__pyx_t_7) { + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((__pyx_t_13 > 0) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1782 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1788 * 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 = 1782; __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 = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L89; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1784 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1790 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -57780,7 +60036,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L89:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1785 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1791 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -57788,41 +60044,42 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * extracts.append((fphr, phrase2, pair_count, tuple(als3))) */ if (PyList_CheckExact(__pyx_v_phrase_list) || PyTuple_CheckExact(__pyx_v_phrase_list)) { - __pyx_t_1 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0; + __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_1 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext; + __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 = 1791; __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_1)) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break; + 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_14 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1791; __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; + } 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_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __pyx_t_16(__pyx_t_14); + if (unlikely(!__pyx_t_15)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_14); + __Pyx_GOTREF(__pyx_t_15); } - if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { - PyObject* sequence = __pyx_t_14; + 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 @@ -57831,105 +60088,102 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_15 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); #endif - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } else - { + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __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_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L92_unpacking_failed; + __pyx_t_1 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_17(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L92_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + index = 1; __pyx_t_11 = __pyx_t_17(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L92_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_17 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L93_unpacking_done; __pyx_L92_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_17 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L93_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_15); - __pyx_t_15 = 0; - __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_11); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1786 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1792 * 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_14 = ((PyObject *)__pyx_v_self->findexes); - __Pyx_INCREF(__pyx_t_14); - if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_14), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF_SET(__pyx_v_als3, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3)); - __pyx_t_3 = 0; + __pyx_t_15 = ((PyObject *)__pyx_v_self->findexes); + __Pyx_INCREF(__pyx_t_15); + if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_v_als3, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_11)); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1787 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1793 * 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_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __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 = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)__pyx_v_als3)); - PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_als3)); + PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_als3)); __Pyx_GIVEREF(((PyObject *)__pyx_v_als3)); - __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 = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__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 = 1793; __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 = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(((PyObject *)__pyx_v_fphr)); - PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_fphr)); + PyTuple_SET_ITEM(__pyx_t_15, 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_15, 1, __pyx_v_phrase2); __Pyx_GIVEREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); + __pyx_t_11 = 0; __pyx_t_3 = 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 = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_extracts, __pyx_t_15); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L84; } __pyx_L84:; @@ -57937,27 +60191,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L79:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1788 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1794 * 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 * f_back_high == f_high and */ - __pyx_t_7 = ((__pyx_v_num_gaps < (__pyx_v_self->max_nonterminals - 1)) != 0); - if (__pyx_t_7) { + __pyx_t_8 = ((__pyx_v_num_gaps < (__pyx_v_self->max_nonterminals - 1)) != 0); + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1789 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1795 * extracts.append((fphr, phrase2, pair_count, tuple(als3))) * if (num_gaps < self.max_nonterminals - 1 and * phrase_len+1 < self.max_length and # <<<<<<<<<<<<<< * f_back_high == f_high and * f_back_low == f_low and */ - __pyx_t_8 = (((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length) != 0); - if (__pyx_t_8) { + __pyx_t_9 = (((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length) != 0); + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1790 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1796 * if (num_gaps < self.max_nonterminals - 1 and * phrase_len+1 < self.max_length and * f_back_high == f_high and # <<<<<<<<<<<<<< @@ -57967,17 +60221,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_18 = ((__pyx_v_f_back_high == __pyx_v_f_high) != 0); if (__pyx_t_18) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1791 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1797 * phrase_len+1 < self.max_length and * 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 * f_low >= self.train_min_gap_size and */ - __pyx_t_9 = ((__pyx_v_f_back_low == __pyx_v_f_low) != 0); - if (__pyx_t_9) { + __pyx_t_10 = ((__pyx_v_f_back_low == __pyx_v_f_low) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1792 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1798 * 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 # <<<<<<<<<<<<<< @@ -57987,7 +60241,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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) != 0); if (__pyx_t_19) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1793 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1799 * 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 # <<<<<<<<<<<<<< @@ -57997,7 +60251,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_20 = ((__pyx_v_f_low >= __pyx_v_self->train_min_gap_size) != 0); if (__pyx_t_20) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1794 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1800 * 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 # <<<<<<<<<<<<<< @@ -58007,7 +60261,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_21 = ((__pyx_v_f_high <= (__pyx_v_f_sent_len - __pyx_v_self->train_min_gap_size)) != 0); if (__pyx_t_21) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1795 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1801 * 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))): # <<<<<<<<<<<<<< @@ -58041,23 +60295,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_t_19 = __pyx_t_20; } else { - __pyx_t_19 = __pyx_t_9; + __pyx_t_19 = __pyx_t_10; } - __pyx_t_9 = __pyx_t_19; + __pyx_t_10 = __pyx_t_19; } else { - __pyx_t_9 = __pyx_t_18; + __pyx_t_10 = __pyx_t_18; } - __pyx_t_18 = __pyx_t_9; + __pyx_t_18 = __pyx_t_10; } else { - __pyx_t_18 = __pyx_t_8; + __pyx_t_18 = __pyx_t_9; } - __pyx_t_8 = __pyx_t_18; + __pyx_t_9 = __pyx_t_18; } else { - __pyx_t_8 = __pyx_t_7; + __pyx_t_9 = __pyx_t_8; } - if (__pyx_t_8) { + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1797 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1803 * ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))): * * met_constraints = 1 # <<<<<<<<<<<<<< @@ -58066,7 +60320,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_met_constraints = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1798 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1804 * * met_constraints = 1 * f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<< @@ -58075,17 +60329,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1799 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1805 * met_constraints = 1 * 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: * f_x_low = f_x_low - 1 */ - __pyx_t_8 = (__pyx_v_self->tight_phrases != 0); - if (__pyx_t_8) { + __pyx_t_9 = (__pyx_v_self->tight_phrases != 0); + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1800 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1806 * 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: # <<<<<<<<<<<<<< @@ -58093,16 +60347,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct * if f_x_low < 0: */ while (1) { - __pyx_t_8 = ((__pyx_v_f_x_low >= 0) != 0); - if (__pyx_t_8) { - __pyx_t_7 = (((__pyx_v_f_links_low[__pyx_v_f_x_low]) == -1) != 0); - __pyx_t_18 = __pyx_t_7; - } else { + __pyx_t_9 = ((__pyx_v_f_x_low >= 0) != 0); + if (__pyx_t_9) { + __pyx_t_8 = (((__pyx_v_f_links_low[__pyx_v_f_x_low]) == -1) != 0); __pyx_t_18 = __pyx_t_8; + } else { + __pyx_t_18 = __pyx_t_9; } if (!__pyx_t_18) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1801 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1807 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 # <<<<<<<<<<<<<< @@ -58115,7 +60369,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L95:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1802 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1808 * 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: # <<<<<<<<<<<<<< @@ -58125,7 +60379,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_18 = ((__pyx_v_f_x_low < 0) != 0); if (__pyx_t_18) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1803 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1809 * f_x_low = f_x_low - 1 * if f_x_low < 0: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -58137,7 +60391,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L98:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1805 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1811 * met_constraints = 0 * * f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<< @@ -58146,7 +60400,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1806 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1812 * * f_x_high = f_high+self.train_min_gap_size * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -58156,7 +60410,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_18 = (__pyx_v_self->tight_phrases != 0); if (__pyx_t_18) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1807 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1813 * 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: # <<<<<<<<<<<<<< @@ -58166,14 +60420,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct while (1) { __pyx_t_18 = ((__pyx_v_f_x_high <= __pyx_v_f_sent_len) != 0); if (__pyx_t_18) { - __pyx_t_8 = (((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) == -1) != 0); - __pyx_t_7 = __pyx_t_8; + __pyx_t_9 = (((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) == -1) != 0); + __pyx_t_8 = __pyx_t_9; } else { - __pyx_t_7 = __pyx_t_18; + __pyx_t_8 = __pyx_t_18; } - if (!__pyx_t_7) break; + if (!__pyx_t_8) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1808 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1814 * 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 # <<<<<<<<<<<<<< @@ -58186,23 +60440,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L99:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1809 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1815 * 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: # <<<<<<<<<<<<<< * met_constraints = 0 * */ - __pyx_t_7 = ((__pyx_v_f_x_high > __pyx_v_f_sent_len) != 0); - if (!__pyx_t_7) { + __pyx_t_8 = ((__pyx_v_f_x_high > __pyx_v_f_sent_len) != 0); + if (!__pyx_t_8) { __pyx_t_18 = (((__pyx_v_f_x_high - __pyx_v_f_x_low) > __pyx_v_self->train_max_initial_size) != 0); - __pyx_t_8 = __pyx_t_18; + __pyx_t_9 = __pyx_t_18; } else { - __pyx_t_8 = __pyx_t_7; + __pyx_t_9 = __pyx_t_8; } - if (__pyx_t_8) { + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1810 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1816 * 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 # <<<<<<<<<<<<<< @@ -58214,7 +60468,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L102:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1812 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1818 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -58223,108 +60477,108 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ if ((__pyx_v_met_constraints != 0)) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1813 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1819 * * 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_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1817 - * e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high, + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1824 * f_sent_len, e_sent_len, - * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< - * 1, 1, 2, 1, 1, 1, 1) == 1) and + * self.train_max_initial_size, self.train_max_initial_size, + * 1, 1, 2, 1, 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, */ - __pyx_t_8 = (((struct __pyx_vtabstruct_4cdec_2sa_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) == 1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_8) { + __pyx_t_9 = (((struct __pyx_vtabstruct_4cdec_2sa_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, 2, 1, 1, 1, 1) == 1); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1819 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1825 * self.train_max_initial_size, self.train_max_initial_size, * 1, 1, 2, 1, 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, */ - __pyx_t_7 = (!(__pyx_v_self->tight_phrases != 0)); - if (!__pyx_t_7) { + __pyx_t_8 = (!(__pyx_v_self->tight_phrases != 0)); + if (!__pyx_t_8) { __pyx_t_18 = ((__pyx_v_f_links_low[__pyx_v_f_x_low]) != -1); if (__pyx_t_18) { - __pyx_t_9 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) != -1); - __pyx_t_19 = __pyx_t_9; + __pyx_t_10 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) != -1); + __pyx_t_19 = __pyx_t_10; } else { __pyx_t_19 = __pyx_t_18; } __pyx_t_18 = __pyx_t_19; } else { - __pyx_t_18 = __pyx_t_7; + __pyx_t_18 = __pyx_t_8; } if (__pyx_t_18) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1820 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1826 * 1, 1, 2, 1, 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_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_f_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1824 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1830 * -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_7 = (((struct __pyx_vtabstruct_4cdec_2sa_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) != 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_7) { + __pyx_t_8 = (((struct __pyx_vtabstruct_4cdec_2sa_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, -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) != 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_8) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1826 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1832 * 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_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1831 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1837 * 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_19 = (((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_high, __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 + 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) != 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __pyx_t_19; + __pyx_t_19 = (((struct __pyx_vtabstruct_4cdec_2sa_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 + 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) != 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_10 = __pyx_t_19; } else { - __pyx_t_9 = __pyx_t_7; + __pyx_t_10 = __pyx_t_8; } - __pyx_t_7 = __pyx_t_9; + __pyx_t_8 = __pyx_t_10; } else { - __pyx_t_7 = __pyx_t_18; + __pyx_t_8 = __pyx_t_18; } - __pyx_t_18 = __pyx_t_7; - } else { __pyx_t_18 = __pyx_t_8; + } else { + __pyx_t_18 = __pyx_t_9; } - __pyx_t_8 = __pyx_t_18; + __pyx_t_9 = __pyx_t_18; } else { - __pyx_t_8 = (__pyx_v_met_constraints != 0); + __pyx_t_9 = (__pyx_v_met_constraints != 0); } - if (__pyx_t_8) { + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1833 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1839 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -58333,7 +60587,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1834 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1840 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -58342,35 +60596,33 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1835 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1841 * 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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1835; __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 = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s_reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1836 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1842 * 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_15 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __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 = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1837 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1843 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -58379,7 +60631,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1838 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1844 * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -58388,27 +60640,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1839 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1845 * 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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1839; __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 = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s_extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __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 = 1845; __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_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1839; __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_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1840 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1846 * i = i+1 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -58418,17 +60670,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_t_2 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1841 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1847 * 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_8 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); - if (__pyx_t_8) { + __pyx_t_9 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0); + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1842 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1848 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -58437,7 +60689,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1843 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1849 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -58449,7 +60701,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1845 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1851 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -58461,7 +60713,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_L106:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1846 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1852 * else: * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -58470,85 +60722,83 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1847 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1853 * 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __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 = 1847; __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; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1848 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1854 * 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 = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr)); - PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr_arr)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_fphr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr)); - __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_14)); __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1851 - * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2, + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1855 + * 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, - * matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<< - * if len(phrase_list) > 0: - * pair_count = 1.0 / len(phrase_list) + * matching.sent_id, e_sent_len, e_sent_start) */ - __pyx_t_14 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_14); __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1852 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1858 * 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 = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = ((__pyx_t_13 > 0) != 0); - if (__pyx_t_8) { + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_13 > 0) != 0); + if (__pyx_t_9) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1853 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1859 * 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 = 1853; __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 = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L107; } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1855 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1861 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -58559,7 +60809,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } __pyx_L107:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1856 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1862 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -58570,7 +60820,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __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 = 1856; __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 = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; } @@ -58578,30 +60828,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __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 = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_16(__pyx_t_14); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __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 @@ -58610,103 +60861,100 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_15 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); #endif - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } else - { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __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_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L110_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_15 = __pyx_t_17(__pyx_t_1); if (unlikely(!__pyx_t_15)) goto __pyx_L110_unpacking_failed; + __Pyx_GOTREF(__pyx_t_15); + index = 1; __pyx_t_11 = __pyx_t_17(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L110_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_17 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L111_unpacking_done; __pyx_L110_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_17 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L111_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_1); - __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_15); + __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_11); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1857 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1863 * pair_count = 0 * 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: */ - __pyx_t_15 = ((PyObject *)__pyx_v_self->findexes); - __Pyx_INCREF(__pyx_t_15); - if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_XDECREF_SET(__pyx_v_als4, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3)); - __pyx_t_3 = 0; + __pyx_t_3 = ((PyObject *)__pyx_v_self->findexes); + __Pyx_INCREF(__pyx_t_3); + if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_als4, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_11)); + __pyx_t_11 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1858 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1864 * 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_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)__pyx_v_als4)); - PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_als4)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_als4)); __Pyx_GIVEREF(((PyObject *)__pyx_v_als4)); - __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 = 1858; __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 = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_fphr)); - PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_fphr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr)); __Pyx_INCREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_phrase2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_phrase2); __Pyx_GIVEREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_3 = 0; - __pyx_t_1 = 0; - __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 = 1858; __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_1); __pyx_t_1 = 0; + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __pyx_t_11 = 0; + __pyx_t_15 = 0; + __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_extracts, __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L103; @@ -58725,22 +60973,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1860 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1866 * extracts.append((fphr, phrase2, pair_count, tuple(als4))) * else: * reason_for_failure = "Unable to extract basic phrase" # <<<<<<<<<<<<<< * * free(sent_links) */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_140)); - __Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_140)); + __Pyx_INCREF(__pyx_kp_s_Unable_to_extract_basic_phrase); + __Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_Unable_to_extract_basic_phrase); } __pyx_L34:; goto __pyx_L33; } __pyx_L33:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1862 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1868 * reason_for_failure = "Unable to extract basic phrase" * * free(sent_links) # <<<<<<<<<<<<<< @@ -58749,7 +60997,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_sent_links); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1863 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1869 * * free(sent_links) * free(f_links_low) # <<<<<<<<<<<<<< @@ -58758,7 +61006,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_f_links_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1864 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1870 * free(sent_links) * free(f_links_low) * free(f_links_high) # <<<<<<<<<<<<<< @@ -58767,7 +61015,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_f_links_high); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1865 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1871 * free(f_links_low) * free(f_links_high) * free(e_links_low) # <<<<<<<<<<<<<< @@ -58776,7 +61024,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_e_links_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1866 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1872 * free(f_links_high) * free(e_links_low) * free(e_links_high) # <<<<<<<<<<<<<< @@ -58785,7 +61033,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_e_links_high); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1867 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1873 * free(e_links_low) * free(e_links_high) * free(f_gap_low) # <<<<<<<<<<<<<< @@ -58794,7 +61042,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_f_gap_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1868 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1874 * free(e_links_high) * free(f_gap_low) * free(f_gap_high) # <<<<<<<<<<<<<< @@ -58803,7 +61051,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_f_gap_high); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1869 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1875 * free(f_gap_low) * free(f_gap_high) * free(e_gap_low) # <<<<<<<<<<<<<< @@ -58812,7 +61060,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_e_gap_low); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1870 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1876 * free(f_gap_high) * free(e_gap_low) * free(e_gap_high) # <<<<<<<<<<<<<< @@ -58821,7 +61069,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct */ free(__pyx_v_e_gap_high); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1872 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1878 * free(e_gap_high) * * return extracts # <<<<<<<<<<<<<< @@ -58833,12 +61081,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_r = __pyx_v_extracts; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1481 + * return ret + * + * cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<< + * cdef int* sent_links, *e_links_low, *e_links_high, *f_links_low, *f_links_high + * cdef int *f_gap_low, *f_gap_high, *e_gap_low, *e_gap_high, num_gaps, gap_start + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -58863,6 +61118,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1886 + * # Aggregate stats from a training instance + * # (Extract rules, update counts) + * def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<< + * + * self.online = True + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -58877,16 +61140,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_instance (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f_words,&__pyx_n_s__e_words,&__pyx_n_s__alignment,&__pyx_n_s__ctx_name,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f_words,&__pyx_n_s_e_words,&__pyx_n_s_alignment,&__pyx_n_s_ctx_name,0}; PyObject* values[4] = {0,0,0,0}; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1880 - * # Aggregate stats from a training instance - * # (Extract rules, update counts) - * def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<< - * - * self.online = True - */ values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -58902,26 +61157,26 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_words)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f_words)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_words)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e_words)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alignment)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ctx_name); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ctx_name); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_instance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_instance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -58940,17 +61195,27 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.add_instance", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instance(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_f_words, __pyx_v_e_words, __pyx_v_alignment, __pyx_v_ctx_name); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1920 + * # f_ i and j are current, e_ i and j are previous + * # We care _considering_ f_j, so it is not yet in counts + * def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<< + * # Phrase extraction limits + * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_1extract(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_1extract = {__Pyx_NAMESTR("extract"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; @@ -58971,7 +61236,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f_i,&__pyx_n_s__f_j,&__pyx_n_s__e_i,&__pyx_n_s__e_j,&__pyx_n_s__min_bound,&__pyx_n_s__wc,&__pyx_n_s__links,&__pyx_n_s__nt,&__pyx_n_s__nt_open,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f_i,&__pyx_n_s_f_j,&__pyx_n_s_e_i,&__pyx_n_s_e_j,&__pyx_n_s_min_bound,&__pyx_n_s_wc,&__pyx_n_s_links,&__pyx_n_s_nt,&__pyx_n_s_nt_open,0}; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -58992,51 +61257,51 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_i)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f_i)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_j)) != 0)) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_bound)) != 0)) kw_args--; + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_bound)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--; + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wc)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__links)) != 0)) kw_args--; + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_links)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--; + if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nt)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 8: - if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt_open)) != 0)) kw_args--; + if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nt_open)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -59063,25 +61328,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.add_instance.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_self, __pyx_v_f_i, __pyx_v_f_j, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_v_nt_open); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914 - * # f_ i and j are current, e_ i and j are previous - * # We care _considering_ f_j, so it is not yet in counts - * def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<< - * # Phrase extraction limits - * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(PyObject *__pyx_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_f_j, PyObject *__pyx_v_e_i, PyObject *__pyx_v_e_j, PyObject *__pyx_v_min_bound, PyObject *__pyx_v_wc, PyObject *__pyx_v_links, PyObject *__pyx_v_nt, PyObject *__pyx_v_nt_open) { struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *__pyx_cur_scope; struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *__pyx_outer_scope; @@ -59119,33 +61378,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1916 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1922 * def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<< * return * # Unaligned word */ - if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __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 = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) { - __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_t_5; } else { @@ -59153,7 +61412,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1917 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1923 * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: * return # <<<<<<<<<<<<<< @@ -59163,45 +61422,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1919 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1925 * return * # Unaligned word * if not al[f_j]: # <<<<<<<<<<<<<< * # Adjacent to non-terminal: extend (non-terminal now open) * if nt and nt[-1][2] == f_j - 1: */ - if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = ((!__pyx_t_6) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1921 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1927 * if not al[f_j]: * # Adjacent to non-terminal: extend (non-terminal now open) * if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<< * nt[-1][2] += 1 * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; } else { @@ -59209,112 +61466,107 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1922 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1928 * # Adjacent to non-terminal: extend (non-terminal now open) * if nt and nt[-1][2] == f_j - 1: * nt[-1][2] += 1 # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) * nt[-1][2] -= 1 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = 2; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_7, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetItemInt(__pyx_t_1, __pyx_t_7, __pyx_t_2, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_t_7, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1923 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1929 * if nt and nt[-1][2] == f_j - 1: * nt[-1][2] += 1 * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) # <<<<<<<<<<<<<< * nt[-1][2] -= 1 * # Unless non-terminal already open, always extend with word */ - __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, Py_True); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1924 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1930 * nt[-1][2] += 1 * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) * nt[-1][2] -= 1 # <<<<<<<<<<<<<< * # Unless non-terminal already open, always extend with word * # Make sure adding a word doesn't exceed length */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = 2; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = 2; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_7, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetItemInt(__pyx_t_4, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_t_2, __pyx_t_7, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L5; } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1927 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1933 * # Unless non-terminal already open, always extend with word * # Make sure adding a word doesn't exceed length * if not nt_open and wc < self.max_length: # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False) * return */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (!__pyx_t_5); if (__pyx_t_3) { - __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_5; } else { __pyx_t_6 = __pyx_t_3; } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1928 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1934 * # Make sure adding a word doesn't exceed length * if not nt_open and wc < self.max_length: * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<< * return * # Aligned word */ - __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_t_4, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_t_2, __pyx_v_links, __pyx_v_nt, Py_False); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6; } __pyx_L6:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1929 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1935 * if not nt_open and wc < self.max_length: * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False) * return # <<<<<<<<<<<<<< @@ -59324,50 +61576,49 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L4; } - __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1931 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1937 * return * # Aligned word * link_i = fe_span[f_j][0] # <<<<<<<<<<<<<< * link_j = fe_span[f_j][1] * new_e_i = min(link_i, e_i) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_fe_span)) { __Pyx_RaiseClosureNameError("fe_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_fe_span)) { __Pyx_RaiseClosureNameError("fe_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_fe_span == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_link_i = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1932 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1938 * # Aligned word * link_i = fe_span[f_j][0] * link_j = fe_span[f_j][1] # <<<<<<<<<<<<<< * new_e_i = min(link_i, e_i) * new_e_j = max(link_j, e_j) */ - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_fe_span)) { __Pyx_RaiseClosureNameError("fe_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_fe_span == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_link_j = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_link_j = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1933 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1939 * link_i = fe_span[f_j][0] * link_j = fe_span[f_j][1] * new_e_i = min(link_i, e_i) # <<<<<<<<<<<<<< @@ -59375,28 +61626,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc * # Check reverse links of newly covered words to see if they violate left */ __Pyx_INCREF(__pyx_v_e_i); - __pyx_t_8 = __pyx_v_e_i; + __pyx_t_1 = __pyx_v_e_i; __Pyx_INCREF(__pyx_v_link_i); __pyx_t_2 = __pyx_v_link_i; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_8); - __pyx_t_4 = __pyx_t_8; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = __pyx_t_1; } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_t_2; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __pyx_t_4; - __Pyx_INCREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_t_4; + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_new_e_i = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_new_e_i = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1934 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1940 * link_j = fe_span[f_j][1] * new_e_i = min(link_i, e_i) * new_e_j = max(link_j, e_j) # <<<<<<<<<<<<<< @@ -59404,28 +61655,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc * # bound (return) or extend minimum right bound for chunk */ __Pyx_INCREF(__pyx_v_e_j); - __pyx_t_8 = __pyx_v_e_j; + __pyx_t_1 = __pyx_v_e_j; __Pyx_INCREF(__pyx_v_link_j); __pyx_t_4 = __pyx_v_link_j; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_8); - __pyx_t_2 = __pyx_t_8; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_1; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_new_e_j = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_new_e_j = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1937 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1943 * # Check reverse links of newly covered words to see if they violate left * # bound (return) or extend minimum right bound for chunk * new_min_bound = min_bound # <<<<<<<<<<<<<< @@ -59435,57 +61686,57 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_INCREF(__pyx_v_min_bound); __pyx_v_new_min_bound = __pyx_v_min_bound; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1939 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1945 * new_min_bound = min_bound * # First aligned word creates span * if e_j == -1: # <<<<<<<<<<<<<< * for i from new_e_i <= i <= new_e_j: * if ef_span[i][0] < f_i: */ - __pyx_t_8 = PyObject_RichCompare(__pyx_v_e_j, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_e_j, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1940 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1946 * # First aligned word creates span * if e_j == -1: * for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_new_e_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_11 = __pyx_t_9; __pyx_t_11 <= __pyx_t_10; __pyx_t_11++) { - __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8); - __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1941 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1947 * if e_j == -1: * for i from new_e_i <= i <= new_e_j: * if ef_span[i][0] < f_i: # <<<<<<<<<<<<<< * return * new_min_bound = max(new_min_bound, ef_span[i][1]) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_ef_span == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1942 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1948 * for i from new_e_i <= i <= new_e_j: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -59495,56 +61746,55 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L10; } - __pyx_L10:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1943 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1949 * if ef_span[i][0] < f_i: * return * new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<< * # Other aligned words extend span * else: */ - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_ef_span == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_INCREF(__pyx_v_new_min_bound); - __pyx_t_8 = __pyx_v_new_min_bound; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_new_min_bound); + __pyx_t_1 = __pyx_v_new_min_bound; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_t_2; } else { - __Pyx_INCREF(__pyx_t_8); - __pyx_t_4 = __pyx_t_8; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = __pyx_t_1; } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_new_min_bound, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1940 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1946 * # First aligned word creates span * if e_j == -1: * for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_2 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; @@ -59552,45 +61802,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } /*else*/ { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1946 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1952 * # Other aligned words extend span * else: * for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_e_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_new_e_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_e_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_9 = __pyx_t_11; __pyx_t_9 < __pyx_t_10; __pyx_t_9++) { - __pyx_t_2 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1947 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1953 * else: * for i from new_e_i <= i < e_i: * if ef_span[i][0] < f_i: # <<<<<<<<<<<<<< * return * new_min_bound = max(new_min_bound, ef_span[i][1]) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_ef_span == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1948 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1954 * for i from new_e_i <= i < e_i: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -59600,99 +61850,98 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L13; } - __pyx_L13:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1949 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1955 * if ef_span[i][0] < f_i: * return * new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<< * for i from e_j < i <= new_e_j: * if ef_span[i][0] < f_i: */ - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_ef_span == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v_new_min_bound); __pyx_t_2 = __pyx_v_new_min_bound; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_4); - __pyx_t_8 = __pyx_t_4; + __pyx_t_1 = __pyx_t_4; } else { __Pyx_INCREF(__pyx_t_2); - __pyx_t_8 = __pyx_t_2; + __pyx_t_1 = __pyx_t_2; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_t_8; + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_new_min_bound, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1946 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1952 * # Other aligned words extend span * else: * for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_4 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1950 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1956 * return * new_min_bound = max(new_min_bound, ef_span[i][1]) * for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_e_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_e_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_11 = __pyx_t_9+1; __pyx_t_11 <= __pyx_t_10; __pyx_t_11++) { - __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1951 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1957 * new_min_bound = max(new_min_bound, ef_span[i][1]) * for i from e_j < i <= new_e_j: * if ef_span[i][0] < f_i: # <<<<<<<<<<<<<< * return * new_min_bound = max(new_min_bound, ef_span[i][1]) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_ef_span == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1952 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1958 * for i from e_j < i <= new_e_j: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -59702,74 +61951,73 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L16; } - __pyx_L16:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1953 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1959 * if ef_span[i][0] < f_i: * return * new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<< * # Extract, extend with word (unless non-terminal open) * if not nt_open: */ - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_ef_span == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_v_new_min_bound); __pyx_t_4 = __pyx_v_new_min_bound; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_8); - __pyx_t_2 = __pyx_t_8; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_1; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_new_min_bound, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_new_min_bound, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1950 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1956 * return * new_min_bound = max(new_min_bound, ef_span[i][1]) * for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<< * if ef_span[i][0] < f_i: * return */ - __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8); - __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_1 = 0; } __pyx_L7:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1955 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1961 * new_min_bound = max(new_min_bound, ef_span[i][1]) * # Extract, extend with word (unless non-terminal open) * if not nt_open: # <<<<<<<<<<<<<< * nt_collision = False * for link in al[f_j]: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((!__pyx_t_6) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1956 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1962 * # Extract, extend with word (unless non-terminal open) * if not nt_open: * nt_collision = False # <<<<<<<<<<<<<< @@ -59778,72 +62026,74 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc */ __pyx_v_nt_collision = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1957 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1963 * if not nt_open: * nt_collision = False * for link in al[f_j]: # <<<<<<<<<<<<<< * if e_nt_cover[link]: * nt_collision = True */ - __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_8 = __pyx_t_12(__pyx_t_2); - if (unlikely(!__pyx_t_8)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_t_12(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1958 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1964 * nt_collision = False * for link in al[f_j]: * if e_nt_cover[link]: # <<<<<<<<<<<<<< * nt_collision = True * # Non-terminal collisions block word extraction and extension, but */ - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_e_nt_cover == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover), __pyx_v_link); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_nt_cover, __pyx_v_link); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1959 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1965 * for link in al[f_j]: * if e_nt_cover[link]: * nt_collision = True # <<<<<<<<<<<<<< @@ -59857,7 +62107,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1962 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1968 * # Non-terminal collisions block word extraction and extension, but * # may be okay for continuing non-terminals * if not nt_collision and wc < self.max_length: # <<<<<<<<<<<<<< @@ -59866,153 +62116,154 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc */ __pyx_t_3 = (!(__pyx_v_nt_collision != 0)); if (__pyx_t_3) { - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; } else { __pyx_t_5 = __pyx_t_3; } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1963 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1969 * # may be okay for continuing non-terminals * if not nt_collision and wc < self.max_length: * plus_links = [] # <<<<<<<<<<<<<< * for link in al[f_j]: * plus_links.append((f_j, link)) */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_plus_links = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_plus_links = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1964 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1970 * if not nt_collision and wc < self.max_length: * plus_links = [] * for link in al[f_j]: # <<<<<<<<<<<<<< * plus_links.append((f_j, link)) * cover[link] += 1 */ - __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_8 = __pyx_t_12(__pyx_t_2); - if (unlikely(!__pyx_t_8)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_t_12(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1965 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1971 * plus_links = [] * for link in al[f_j]: * plus_links.append((f_j, link)) # <<<<<<<<<<<<<< * cover[link] += 1 * links.append(plus_links) */ - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_f_j); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_j); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_f_j); __Pyx_GIVEREF(__pyx_v_f_j); __Pyx_INCREF(__pyx_v_link); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_link); __Pyx_GIVEREF(__pyx_v_link); - __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_plus_links, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_plus_links, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1966 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1972 * for link in al[f_j]: * plus_links.append((f_j, link)) * cover[link] += 1 # <<<<<<<<<<<<<< * links.append(plus_links) * if links and f_j >= new_min_bound: */ - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_cover) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_cover == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); __pyx_t_14 = __pyx_cur_scope->__pyx_v_cover; __Pyx_INCREF(__pyx_v_link); - __pyx_t_8 = __pyx_v_link; - if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) { + __pyx_t_1 = __pyx_v_link; + if (unlikely(__pyx_t_14 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_t_14), __pyx_t_8); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_t_14, __pyx_t_1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) { + if (unlikely(__pyx_t_14 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (PyObject_SetItem(((PyObject *)__pyx_t_14), __pyx_t_8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_14, __pyx_t_1, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1967 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1973 * plus_links.append((f_j, link)) * cover[link] += 1 * links.append(plus_links) # <<<<<<<<<<<<<< * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) */ - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_links, ((PyObject *)__pyx_v_plus_links)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_links, __pyx_v_plus_links); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1968 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1974 * cover[link] += 1 * links.append(plus_links) * if links and f_j >= new_min_bound: # <<<<<<<<<<<<<< * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __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 = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __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 = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_3; } else { @@ -60020,176 +62271,176 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1969 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1975 * links.append(plus_links) * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * links.pop() */ - if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_rules) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_rules == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_1, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_1, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_f_i); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_i); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_f_i); __Pyx_GIVEREF(__pyx_v_f_i); __Pyx_INCREF(__pyx_v_new_e_i); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_new_e_i); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_new_e_i); __Pyx_GIVEREF(__pyx_v_new_e_i); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_nt); - PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_nt); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_nt); __Pyx_GIVEREF(__pyx_v_nt); __Pyx_INCREF(__pyx_v_links); - PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_v_links); + PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_links); __Pyx_GIVEREF(__pyx_v_links); - __pyx_t_1 = 0; + __pyx_t_8 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __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_8)); __pyx_t_8 = 0; - __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L24; } __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1970 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1976 * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<< * links.pop() * for link in al[f_j]: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_1, __pyx_v_links, __pyx_v_nt, Py_False); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __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_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1971 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1977 * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * links.pop() # <<<<<<<<<<<<<< * for link in al[f_j]: * cover[link] -= 1 */ - __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1972 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1978 * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * links.pop() * for link in al[f_j]: # <<<<<<<<<<<<<< * cover[link] -= 1 * # Try to add a word to current non-terminal (if any), extract, extend */ - __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { - if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; + if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_1 = __pyx_t_12(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_t_12(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_2); + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1973 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1979 * links.pop() * for link in al[f_j]: * cover[link] -= 1 # <<<<<<<<<<<<<< * # Try to add a word to current non-terminal (if any), extract, extend * if nt and nt[-1][2] == f_j - 1: */ - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_cover) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_cover == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); __pyx_t_14 = __pyx_cur_scope->__pyx_v_cover; __Pyx_INCREF(__pyx_v_link); - __pyx_t_1 = __pyx_v_link; - if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) { + __pyx_t_2 = __pyx_v_link; + if (unlikely(__pyx_t_14 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_t_14), __pyx_t_1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_t_14, __pyx_t_2); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) { + __pyx_t_8 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__pyx_t_14 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (PyObject_SetItem(((PyObject *)__pyx_t_14), __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_14, __pyx_t_2, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L21; } __pyx_L21:; @@ -60197,126 +62448,126 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L17:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1975 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1981 * cover[link] -= 1 * # Try to add a word to current non-terminal (if any), extract, extend * if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<< * # Add to non-terminal, checking for collisions * old_last_nt = nt[-1][:] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = __pyx_t_5; } else { __pyx_t_3 = __pyx_t_6; } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1977 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1983 * if nt and nt[-1][2] == f_j - 1: * # Add to non-terminal, checking for collisions * old_last_nt = nt[-1][:] # <<<<<<<<<<<<<< * nt[-1][2] = f_j * if link_i < nt[-1][3]: */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, NULL, &__pyx_k_slice_141, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_old_last_nt = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, NULL, NULL, &__pyx_slice__67, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_old_last_nt = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1978 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1984 * # Add to non-terminal, checking for collisions * old_last_nt = nt[-1][:] * nt[-1][2] = f_j # <<<<<<<<<<<<<< * if link_i < nt[-1][3]: * if not span_check(cover, link_i, nt[-1][3] - 1): */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemInt(__pyx_t_2, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_SetItemInt(__pyx_t_1, 2, __pyx_v_f_j, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1979 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1985 * old_last_nt = nt[-1][:] * nt[-1][2] = f_j * if link_i < nt[-1][3]: # <<<<<<<<<<<<<< * if not span_check(cover, link_i, nt[-1][3] - 1): * nt[-1] = old_last_nt */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1980 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1986 * nt[-1][2] = f_j * if link_i < nt[-1][3]: * if not span_check(cover, link_i, nt[-1][3] - 1): # <<<<<<<<<<<<<< * nt[-1] = old_last_nt * return */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_check); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cover); __Pyx_INCREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_link_i); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_6 = ((!__pyx_t_3) != 0); if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1981 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1987 * if link_i < nt[-1][3]: * if not span_check(cover, link_i, nt[-1][3] - 1): * nt[-1] = old_last_nt # <<<<<<<<<<<<<< * return * span_inc(cover, link_i, nt[-1][3] - 1) */ - if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1982 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1988 * if not span_check(cover, link_i, nt[-1][3] - 1): * nt[-1] = old_last_nt * return # <<<<<<<<<<<<<< @@ -60326,160 +62577,159 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L29; } - __pyx_L29:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1983 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1989 * nt[-1] = old_last_nt * return * span_inc(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< * span_inc(e_nt_cover, link_i, nt[-1][3] - 1) * nt[-1][3] = link_i */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cover); __Pyx_INCREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_link_i); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __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_2)); __pyx_t_2 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1984 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1990 * return * span_inc(cover, link_i, nt[-1][3] - 1) * span_inc(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< * nt[-1][3] = link_i * if link_j > nt[-1][4]: */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_e_nt_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_nt_cover); __Pyx_INCREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_link_i); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __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_4)); __pyx_t_4 = 0; + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1985 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1991 * span_inc(cover, link_i, nt[-1][3] - 1) * span_inc(e_nt_cover, link_i, nt[-1][3] - 1) * nt[-1][3] = link_i # <<<<<<<<<<<<<< * if link_j > nt[-1][4]: * if not span_check(cover, nt[-1][4] + 1, link_j): */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemInt(__pyx_t_2, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_SetItemInt(__pyx_t_1, 3, __pyx_v_link_i, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L28; } __pyx_L28:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1986 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1992 * span_inc(e_nt_cover, link_i, nt[-1][3] - 1) * nt[-1][3] = link_i * if link_j > nt[-1][4]: # <<<<<<<<<<<<<< * if not span_check(cover, nt[-1][4] + 1, link_j): * nt[-1] = old_last_nt */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1987 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1993 * nt[-1][3] = link_i * if link_j > nt[-1][4]: * if not span_check(cover, nt[-1][4] + 1, link_j): # <<<<<<<<<<<<<< * nt[-1] = old_last_nt * return */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_check); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_link_j); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_link_j); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = ((!__pyx_t_6) != 0); if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1988 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1994 * if link_j > nt[-1][4]: * if not span_check(cover, nt[-1][4] + 1, link_j): * nt[-1] = old_last_nt # <<<<<<<<<<<<<< * return * span_inc(cover, nt[-1][4] + 1, link_j) */ - if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1989 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1995 * if not span_check(cover, nt[-1][4] + 1, link_j): * nt[-1] = old_last_nt * return # <<<<<<<<<<<<<< @@ -60489,372 +62739,369 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L31; } - __pyx_L31:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1990 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1996 * nt[-1] = old_last_nt * return * span_inc(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<< * span_inc(e_nt_cover, nt[-1][4] + 1, link_j) * nt[-1][4] = link_j */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_link_j); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __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_2)); __pyx_t_2 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1991 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1997 * return * span_inc(cover, nt[-1][4] + 1, link_j) * span_inc(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<< * nt[-1][4] = link_j * if links and f_j >= new_min_bound: */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_e_nt_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_nt_cover); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_link_j); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_link_j); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __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_4)); __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1992 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1998 * span_inc(cover, nt[-1][4] + 1, link_j) * span_inc(e_nt_cover, nt[-1][4] + 1, link_j) * nt[-1][4] = link_j # <<<<<<<<<<<<<< * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemInt(__pyx_t_2, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__Pyx_SetItemInt(__pyx_t_1, 4, __pyx_v_link_j, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L30; } __pyx_L30:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1993 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1999 * span_inc(e_nt_cover, nt[-1][4] + 1, link_j) * nt[-1][4] = link_j * if links and f_j >= new_min_bound: # <<<<<<<<<<<<<< * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; } else { __pyx_t_5 = __pyx_t_3; } if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1994 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2000 * nt[-1][4] = link_j * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) * nt[-1] = old_last_nt */ - if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_rules) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_rules == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_form_rule); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_f_i); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_i); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_i); __Pyx_GIVEREF(__pyx_v_f_i); __Pyx_INCREF(__pyx_v_new_e_i); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_new_e_i); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_new_e_i); __Pyx_GIVEREF(__pyx_v_new_e_i); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_nt); - PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_nt); + PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_nt); __Pyx_GIVEREF(__pyx_v_nt); __Pyx_INCREF(__pyx_v_links); - PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_links); + PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_v_links); __Pyx_GIVEREF(__pyx_v_links); - __pyx_t_1 = 0; - __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_8); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L32; } __pyx_L32:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1995 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2001 * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) # <<<<<<<<<<<<<< * nt[-1] = old_last_nt * if link_i < nt[-1][3]: */ - __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_8, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, Py_False); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1996 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2002 * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) * nt[-1] = old_last_nt # <<<<<<<<<<<<<< * if link_i < nt[-1][3]: * span_dec(cover, link_i, nt[-1][3] - 1) */ - if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1997 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2003 * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) * nt[-1] = old_last_nt * if link_i < nt[-1][3]: # <<<<<<<<<<<<<< * span_dec(cover, link_i, nt[-1][3] - 1) * span_dec(e_nt_cover, link_i, nt[-1][3] - 1) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1998 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2004 * nt[-1] = old_last_nt * if link_i < nt[-1][3]: * span_dec(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< * span_dec(e_nt_cover, link_i, nt[-1][3] - 1) * if link_j > nt[-1][4]: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cover); __Pyx_INCREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link_i); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __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_8)); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1999 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2005 * if link_i < nt[-1][3]: * span_dec(cover, link_i, nt[-1][3] - 1) * span_dec(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< * if link_j > nt[-1][4]: * span_dec(cover, nt[-1][4] + 1, link_j) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_e_nt_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_nt_cover); __Pyx_INCREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_link_i); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __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_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L33; } __pyx_L33:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2000 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2006 * span_dec(cover, link_i, nt[-1][3] - 1) * span_dec(e_nt_cover, link_i, nt[-1][3] - 1) * if link_j > nt[-1][4]: # <<<<<<<<<<<<<< * span_dec(cover, nt[-1][4] + 1, link_j) * span_dec(e_nt_cover, nt[-1][4] + 1, link_j) */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2001 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2007 * span_dec(e_nt_cover, link_i, nt[-1][3] - 1) * if link_j > nt[-1][4]: * span_dec(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<< * span_dec(e_nt_cover, nt[-1][4] + 1, link_j) * # Try to start a new non-terminal, extract, extend */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2002 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2008 * if link_j > nt[-1][4]: * span_dec(cover, nt[-1][4] + 1, link_j) * span_dec(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<< * # Try to start a new non-terminal, extract, extend * if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_e_nt_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_nt_cover); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_link_j); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __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_8)); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L34; } @@ -60863,41 +63110,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } __pyx_L27:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2004 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2010 * span_dec(e_nt_cover, nt[-1][4] + 1, link_j) * # Try to start a new non-terminal, extract, extend * if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals: # <<<<<<<<<<<<<< * # Check for collisions * if not span_check(cover, link_i, link_j): */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (!__pyx_t_5); if (!__pyx_t_3) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_5; } else { __pyx_t_6 = __pyx_t_3; } if (__pyx_t_6) { - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - __pyx_t_7 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = (__pyx_t_7 < __pyx_cur_scope->__pyx_v_self->max_nonterminals); __pyx_t_15 = __pyx_t_5; } else { @@ -60909,37 +63158,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2006 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2012 * if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals: * # Check for collisions * if not span_check(cover, link_i, link_j): # <<<<<<<<<<<<<< * return * span_inc(cover, link_i, link_j) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cover); __Pyx_INCREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link_i); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); __Pyx_INCREF(__pyx_v_link_j); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_6 = ((!__pyx_t_3) != 0); if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2007 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2013 * # Check for collisions * if not span_check(cover, link_i, link_j): * return # <<<<<<<<<<<<<< @@ -60949,153 +63198,151 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L36; } - __pyx_L36:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2008 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2014 * if not span_check(cover, link_i, link_j): * return * span_inc(cover, link_i, link_j) # <<<<<<<<<<<<<< * span_inc(e_nt_cover, link_i, link_j) * nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cover); __Pyx_INCREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link_i); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); __Pyx_INCREF(__pyx_v_link_j); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __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_8)); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2009 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2015 * return * span_inc(cover, link_i, link_j) * span_inc(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<< * nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) * # Require at least one word in phrase */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_e_nt_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_nt_cover); __Pyx_INCREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link_i); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); __Pyx_INCREF(__pyx_v_link_j); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2010 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2016 * span_inc(cover, link_i, link_j) * span_inc(e_nt_cover, link_i, link_j) * nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) # <<<<<<<<<<<<<< * # Require at least one word in phrase * if links and f_j >= new_min_bound: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_1; + __pyx_t_1 = 0; } else { __Pyx_INCREF(__pyx_int_1); - __pyx_t_2 = __pyx_int_1; + __pyx_t_8 = __pyx_int_1; } - __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_f_j); - PyList_SET_ITEM(__pyx_t_8, 1, __pyx_v_f_j); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_f_j); __Pyx_GIVEREF(__pyx_v_f_j); __Pyx_INCREF(__pyx_v_f_j); - PyList_SET_ITEM(__pyx_t_8, 2, __pyx_v_f_j); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_v_f_j); __Pyx_GIVEREF(__pyx_v_f_j); __Pyx_INCREF(__pyx_v_link_i); - PyList_SET_ITEM(__pyx_t_8, 3, __pyx_v_link_i); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); __Pyx_INCREF(__pyx_v_link_j); - PyList_SET_ITEM(__pyx_t_8, 4, __pyx_v_link_j); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = 0; + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_nt, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2012 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2018 * nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) * # Require at least one word in phrase * if links and f_j >= new_min_bound: # <<<<<<<<<<<<<< * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __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 = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __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[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_15 = __pyx_t_3; } else { __pyx_t_15 = __pyx_t_6; } if (__pyx_t_15) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2013 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2019 * # Require at least one word in phrase * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * nt.pop() */ - if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_rules) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_rules == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_form_rule); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_i); @@ -61105,8 +63352,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_GIVEREF(__pyx_v_new_e_i); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_nt); PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_nt); __Pyx_GIVEREF(__pyx_v_nt); @@ -61114,104 +63361,112 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_v_links); __Pyx_GIVEREF(__pyx_v_links); __pyx_t_4 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __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_8)); __pyx_t_8 = 0; - __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __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_8); __pyx_t_8 = 0; + __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_2); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L37; } __pyx_L37:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2014 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2020 * if links and f_j >= new_min_bound: * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<< * nt.pop() * span_dec(cover, link_i, link_j) */ - __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_2, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, Py_False); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __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_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2015 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2021 * rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * nt.pop() # <<<<<<<<<<<<<< * span_dec(cover, link_i, link_j) * span_dec(e_nt_cover, link_i, link_j) */ - __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2016 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2022 * extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) * nt.pop() * span_dec(cover, link_i, link_j) # <<<<<<<<<<<<<< * span_dec(e_nt_cover, link_i, link_j) * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover)); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cover); __Pyx_INCREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_link_i); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); __Pyx_INCREF(__pyx_v_link_j); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2017 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2023 * nt.pop() * span_dec(cover, link_i, link_j) * span_dec(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<< * * # Try to extract phrases from every f index */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover)); + if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_e_nt_cover); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_nt_cover); __Pyx_INCREF(__pyx_v_link_i); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_link_i); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link_i); __Pyx_GIVEREF(__pyx_v_link_i); __Pyx_INCREF(__pyx_v_link_j); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __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_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L35; } __pyx_L35:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1920 + * # f_ i and j are current, e_ i and j are previous + * # We care _considering_ f_j, so it is not yet in counts + * def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<< + * # Phrase extraction limits + * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -61219,7 +63474,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(((PyObject *)__pyx_t_14)); + __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.add_instance.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -61237,7 +63492,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1880 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1886 * # Aggregate stats from a training instance * # (Extract rules, update counts) * def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<< @@ -61270,9 +63525,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; - long __pyx_t_10; - int __pyx_t_11; - PyObject *__pyx_t_12 = NULL; + int __pyx_t_10; + long __pyx_t_11; + int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; @@ -61295,7 +63550,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_words); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1882 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1888 * def add_instance(self, f_words, e_words, alignment, ctx_name=None): * * self.online = True # <<<<<<<<<<<<<< @@ -61304,20 +63559,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc */ __pyx_cur_scope->__pyx_v_self->online = 1; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1889 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1895 * # span more than once. * # (f, e, al, lex_f_i, lex_f_j) * rules = set() # <<<<<<<<<<<<<< * * f_len = len(f_words) */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_rules = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1891 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1897 * rules = set() * * f_len = len(f_words) # <<<<<<<<<<<<<< @@ -61326,15 +63581,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_f_words; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1891; __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[8]; __pyx_lineno = 1897; __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[8]; __pyx_lineno = 1891; __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[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_f_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1892 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1898 * * f_len = len(f_words) * e_len = len(e_words) # <<<<<<<<<<<<<< @@ -61343,35 +63598,35 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1892; __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[8]; __pyx_lineno = 1898; __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[8]; __pyx_lineno = 1892; __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[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_e_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1895 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1901 * * # Pre-compute alignment info * al = [[] for i in range(f_len)] # <<<<<<<<<<<<<< * fe_span = [[e_len + 1, -1] for i in range(f_len)] * ef_span = [[f_len + 1, -1] for i in range(e_len)] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __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 = 1901; __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[8]; __pyx_lineno = 1895; __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 = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_len); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f_len); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_len); - __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -61380,23 +63635,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -61404,38 +63660,38 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __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_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_cur_scope->__pyx_v_al = ((PyObject *)__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_al = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1896 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1902 * # Pre-compute alignment info * al = [[] for i in range(f_len)] * fe_span = [[e_len + 1, -1] for i in range(f_len)] # <<<<<<<<<<<<<< * ef_span = [[f_len + 1, -1] for i in range(e_len)] * for f, e in alignment: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __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 = 1902; __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[8]; __pyx_lineno = 1896; __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 = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_len); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f_len); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_len); - __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -61444,23 +63700,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -61468,9 +63725,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_v_e_len, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_e_len, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -61478,36 +63735,36 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); __pyx_t_4 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_fe_span = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1897 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1903 * al = [[] for i in range(f_len)] * fe_span = [[e_len + 1, -1] for i in range(f_len)] * ef_span = [[f_len + 1, -1] for i in range(e_len)] # <<<<<<<<<<<<<< * for f, e in alignment: * al[f].append(e) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __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 = 1903; __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[8]; __pyx_lineno = 1897; __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 = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_e_len); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_e_len); __Pyx_GIVEREF(__pyx_v_e_len); - __pyx_t_6 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) { __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -61516,23 +63773,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_6 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_6)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -61540,9 +63798,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); @@ -61550,15 +63808,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __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_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_ef_span = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1898 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1904 * fe_span = [[e_len + 1, -1] for i in range(f_len)] * ef_span = [[f_len + 1, -1] for i in range(e_len)] * for f, e in alignment: # <<<<<<<<<<<<<< @@ -61569,7 +63827,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_t_1 = __pyx_v_alignment; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -61577,23 +63835,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1904; __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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -61609,7 +63868,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -61622,16 +63881,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __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 = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - { + } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __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; @@ -61639,7 +63897,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L12_unpacking_done; @@ -61647,7 +63905,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L12_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4); @@ -61655,21 +63913,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1899 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1905 * ef_span = [[f_len + 1, -1] for i in range(e_len)] * for f, e in alignment: * al[f].append(e) # <<<<<<<<<<<<<< * fe_span[f][0] = min(fe_span[f][0], e) * fe_span[f][1] = max(fe_span[f][1], e) */ - __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_e); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1900 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1906 * for f, e in alignment: * al[f].append(e) * fe_span[f][0] = min(fe_span[f][0], e) # <<<<<<<<<<<<<< @@ -61677,34 +63933,34 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc * ef_span[e][0] = min(ef_span[e][0], f) */ __Pyx_INCREF(__pyx_v_e); - __pyx_t_6 = __pyx_v_e; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_e; + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_9) { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_3 = __pyx_t_6; + if (__pyx_t_10) { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_6 = __pyx_t_3; } else { __Pyx_INCREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; + __pyx_t_6 = __pyx_t_4; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __pyx_t_3; - __Pyx_INCREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemInt(__pyx_t_3, 0, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_t_6; + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1901 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1907 * al[f].append(e) * fe_span[f][0] = min(fe_span[f][0], e) * fe_span[f][1] = max(fe_span[f][1], e) # <<<<<<<<<<<<<< @@ -61712,34 +63968,34 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc * ef_span[e][1] = max(ef_span[e][1], f) */ __Pyx_INCREF(__pyx_v_e); - __pyx_t_6 = __pyx_v_e; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_e; + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_9) { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_3 = __pyx_t_6; + if (__pyx_t_10) { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_6 = __pyx_t_3; } else { __Pyx_INCREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; + __pyx_t_6 = __pyx_t_4; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __pyx_t_3; - __Pyx_INCREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_t_6; + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_SetItemInt(__pyx_t_6, 1, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1902 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1908 * fe_span[f][0] = min(fe_span[f][0], e) * fe_span[f][1] = max(fe_span[f][1], e) * ef_span[e][0] = min(ef_span[e][0], f) # <<<<<<<<<<<<<< @@ -61747,34 +64003,34 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc * */ __Pyx_INCREF(__pyx_v_f); - __pyx_t_6 = __pyx_v_f; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_f; + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_9) { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_3 = __pyx_t_6; + if (__pyx_t_10) { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_6 = __pyx_t_3; } else { __Pyx_INCREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; + __pyx_t_6 = __pyx_t_4; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __pyx_t_3; - __Pyx_INCREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemInt(__pyx_t_3, 0, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_t_6; + __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1903 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1909 * fe_span[f][1] = max(fe_span[f][1], e) * ef_span[e][0] = min(ef_span[e][0], f) * ef_span[e][1] = max(ef_span[e][1], f) # <<<<<<<<<<<<<< @@ -61782,69 +64038,69 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc * # Target side word coverage */ __Pyx_INCREF(__pyx_v_f); - __pyx_t_6 = __pyx_v_f; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_f; + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_9) { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_3 = __pyx_t_6; + if (__pyx_t_10) { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_6 = __pyx_t_3; } else { __Pyx_INCREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; + __pyx_t_6 = __pyx_t_4; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __pyx_t_3; - __Pyx_INCREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_t_6; + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_SetItemInt(__pyx_t_6, 1, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1906 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1912 * * # Target side word coverage * cover = [0] * e_len # <<<<<<<<<<<<<< * # Non-terminal coverage * f_nt_cover = [0] * f_len */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_temp; } - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_cover = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1908 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1914 * cover = [0] * e_len * # Non-terminal coverage * f_nt_cover = [0] * f_len # <<<<<<<<<<<<<< * e_nt_cover = [0] * e_len * */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_f_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_f_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_temp; @@ -61852,65 +64108,65 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __pyx_v_f_nt_cover = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1909 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1915 * # Non-terminal coverage * f_nt_cover = [0] * f_len * e_nt_cover = [0] * e_len # <<<<<<<<<<<<<< * * # Extract all possible hierarchical phrases starting at a source index */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_temp; } - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_e_nt_cover = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1920 * # f_ i and j are current, e_ i and j are previous * # We care _considering_ f_j, so it is not yet in counts * def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<< * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, __pyx_n_s_145, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_143)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, __pyx_n_s_add_instance_locals_extract, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cdec_sa__sa, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2020 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2026 * * # Try to extract phrases from every f index * for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<< * # Skip if phrases won't be tight on left side * if not al[f_i]: */ - __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_10; __pyx_v_f_i++) { + __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_11; __pyx_v_f_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2022 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2028 * for f_i from 0 <= f_i < f_len: * # Skip if phrases won't be tight on left side * if not al[f_i]: # <<<<<<<<<<<<<< * continue * extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_i, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = ((!__pyx_t_9) != 0); - if (__pyx_t_11) { + __pyx_t_12 = ((!__pyx_t_10) != 0); + if (__pyx_t_12) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2023 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2029 * # Skip if phrases won't be tight on left side * if not al[f_i]: * continue # <<<<<<<<<<<<<< @@ -61918,111 +64174,107 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc * */ goto __pyx_L13_continue; - goto __pyx_L15; } - __pyx_L15:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2024 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2030 * if not al[f_i]: * continue * extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) # <<<<<<<<<<<<<< * * stats = self.online_stats[ctx_name] */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_f_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_6, __pyx_t_3, __pyx_int_neg_1, __pyx_t_4, __pyx_int_0, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_12), __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_3, __pyx_t_6, __pyx_int_neg_1, __pyx_t_4, __pyx_int_0, __pyx_t_7, __pyx_t_13, Py_False); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __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_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_L13_continue:; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2026 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2032 * extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) * * stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<< * * # Update possible phrases (samples) */ - __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_v_ctx_name); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_14); __pyx_v_stats = __pyx_t_14; __pyx_t_14 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2031 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2037 * # This could be more efficiently integrated with extraction * # at the cost of readability * for f, lex_i, lex_j in self.get_f_phrases(f_words): # <<<<<<<<<<<<<< * stats.samples_f[f] += 1 * */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_get_f_phrases); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_f_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words); - __pyx_t_12 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; - if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) { - __pyx_t_13 = __pyx_t_12; __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_13 = __pyx_t_7; __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = Py_TYPE(__pyx_t_13)->tp_iternext; } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_13)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_13)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_13)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_13)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_12 = __pyx_t_5(__pyx_t_13); - if (unlikely(!__pyx_t_12)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_t_5(__pyx_t_13); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_7); } - if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { - PyObject* sequence = __pyx_t_12; + if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { + PyObject* sequence = __pyx_t_7; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else @@ -62031,44 +64283,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_14 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); - __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); #endif - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else - { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else { Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_14 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_14)) goto __pyx_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - index = 2; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L18_unpacking_failed; + index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L19_unpacking_done; @@ -62076,75 +64327,76 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L19_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF_SET(__pyx_v_lex_i, __pyx_t_7); - __pyx_t_7 = 0; - __Pyx_XDECREF_SET(__pyx_v_lex_j, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_lex_i, __pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_lex_j, __pyx_t_6); + __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2032 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2038 * # at the cost of readability * for f, lex_i, lex_j in self.get_f_phrases(f_words): * stats.samples_f[f] += 1 # <<<<<<<<<<<<<< * * # Update phrase counts */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_v_f); - __pyx_t_4 = __pyx_v_f; - __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s_samples_f); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(__pyx_v_f); + __pyx_t_6 = __pyx_v_f; + __pyx_t_4 = PyObject_GetItem(__pyx_t_7, __pyx_t_6); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_t_6, __pyx_t_14) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2035 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2041 * * # Update phrase counts * for rule in rules: # <<<<<<<<<<<<<< * (f_ph, e_ph, al) = rule[:3] * stats.phrases_f[f_ph] += 1 */ - __pyx_t_13 = PyObject_GetIter(((PyObject *)__pyx_cur_scope->__pyx_v_rules)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_rules); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = Py_TYPE(__pyx_t_13)->tp_iternext; for (;;) { { - __pyx_t_12 = __pyx_t_5(__pyx_t_13); - if (unlikely(!__pyx_t_12)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_t_5(__pyx_t_13); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_XDECREF_SET(__pyx_v_rule, __pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_rule, __pyx_t_7); + __pyx_t_7 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2036 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2042 * # Update phrase counts * for rule in rules: * (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<< * stats.phrases_f[f_ph] += 1 * stats.phrases_e[e_ph] += 1 */ - __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_rule, 0, 3, NULL, NULL, &__pyx_k_slice_146, 0, 1, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { - PyObject* sequence = __pyx_t_12; + __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_rule, 0, 3, NULL, NULL, &__pyx_slice__70, 0, 1, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { + PyObject* sequence = __pyx_t_7; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else @@ -62153,44 +64405,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_14 = PyList_GET_ITEM(sequence, 1); - __pyx_t_7 = PyList_GET_ITEM(sequence, 2); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); #endif - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else - { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else { Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; - index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L22_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); + index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L22_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_14 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_14)) goto __pyx_L22_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - index = 2; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L22_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + index = 2; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L22_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L23_unpacking_done; @@ -62198,124 +64449,191 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L23_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_f_ph, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_f_ph, __pyx_t_6); + __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_e_ph, __pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_al); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_al, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_al, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2037 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2043 * for rule in rules: * (f_ph, e_ph, al) = rule[:3] * stats.phrases_f[f_ph] += 1 # <<<<<<<<<<<<<< * stats.phrases_e[e_ph] += 1 * stats.phrases_fe[f_ph][e_ph] += 1 */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s_phrases_f); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_f_ph); - __pyx_t_7 = __pyx_v_f_ph; - __pyx_t_14 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_v_f_ph; + __pyx_t_14 = PyObject_GetItem(__pyx_t_7, __pyx_t_4); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_14); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_t_4, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2038 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2044 * (f_ph, e_ph, al) = rule[:3] * stats.phrases_f[f_ph] += 1 * stats.phrases_e[e_ph] += 1 # <<<<<<<<<<<<<< * stats.phrases_fe[f_ph][e_ph] += 1 * if not stats.phrases_al[f_ph][e_ph]: */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_e); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s_phrases_e); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_e_ph); - __pyx_t_7 = __pyx_v_e_ph; - __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_v_e_ph; + __pyx_t_6 = PyObject_GetItem(__pyx_t_7, __pyx_t_4); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_t_4, __pyx_t_14) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2039 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2045 * stats.phrases_f[f_ph] += 1 * stats.phrases_e[e_ph] += 1 * stats.phrases_fe[f_ph][e_ph] += 1 # <<<<<<<<<<<<<< * if not stats.phrases_al[f_ph][e_ph]: * stats.phrases_al[f_ph][e_ph] = al */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_f_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s_phrases_fe); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_4 = PyObject_GetItem(__pyx_t_7, __pyx_v_f_ph); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_v_e_ph); - __pyx_t_12 = __pyx_v_e_ph; - __pyx_t_14 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_v_e_ph; + __pyx_t_14 = PyObject_GetItem(__pyx_t_4, __pyx_t_7); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_14); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_t_7, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2040 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2046 * stats.phrases_e[e_ph] += 1 * stats.phrases_fe[f_ph][e_ph] += 1 * if not stats.phrases_al[f_ph][e_ph]: # <<<<<<<<<<<<<< * stats.phrases_al[f_ph][e_ph] = al * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = PyObject_GetItem(__pyx_t_7, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_e_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s_phrases_al); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_v_f_ph); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetItem(__pyx_t_7, __pyx_v_e_ph); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_9 = ((!__pyx_t_11) != 0); - if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = ((!__pyx_t_12) != 0); + if (__pyx_t_10) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2041 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2047 * stats.phrases_fe[f_ph][e_ph] += 1 * if not stats.phrases_al[f_ph][e_ph]: * stats.phrases_al[f_ph][e_ph] = al # <<<<<<<<<<<<<< * - * # Create a rule from source, target, non-terminals, and alignments + * # Update bilexical dictionary (if exists) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s_phrases_al); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_v_f_ph); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = PyObject_GetItem(__pyx_t_7, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyObject_SetItem(__pyx_t_12, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L24; } __pyx_L24:; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2050 + * + * # Update bilexical dictionary (if exists) + * if self.bilex: # <<<<<<<<<<<<<< + * self.bilex.update(f_words, e_words, alignment) + * else: + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_self->bilex); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_10) { + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2051 + * # Update bilexical dictionary (if exists) + * if self.bilex: + * self.bilex.update(f_words, e_words, alignment) # <<<<<<<<<<<<<< + * else: + * logger.warning('No online bilexical dictionary specified, not updating lexical weights') + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->bilex, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_f_words); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_words); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_cur_scope->__pyx_v_e_words); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_words); + __Pyx_INCREF(__pyx_v_alignment); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_alignment); + __Pyx_GIVEREF(__pyx_v_alignment); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L25; + } + /*else*/ { + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2053 + * self.bilex.update(f_words, e_words, alignment) + * else: + * logger.warning('No online bilexical dictionary specified, not updating lexical weights') # <<<<<<<<<<<<<< + * + * # Create a rule from source, target, non-terminals, and alignments + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warning); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L25:; + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1886 + * # Aggregate stats from a training instance + * # (Extract rules, update counts) + * def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<< + * + * self.online = True + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -62324,7 +64642,6 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.add_instance", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -62347,6 +64664,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2056 + * + * # Create a rule from source, target, non-terminals, and alignments + * def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<< + * + * # Substitute in non-terminals + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -62363,7 +64688,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("form_rule (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f_i,&__pyx_n_s__e_i,&__pyx_n_s__f_span,&__pyx_n_s__e_span,&__pyx_n_s__nt,&__pyx_n_s__al,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f_i,&__pyx_n_s_e_i,&__pyx_n_s_f_span,&__pyx_n_s_e_span,&__pyx_n_s_nt,&__pyx_n_s_al,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -62381,36 +64706,36 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_i)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f_i)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_span)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f_span)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_span)) != 0)) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e_span)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--; + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nt)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__al)) != 0)) kw_args--; + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_al)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "form_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "form_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -62431,17 +64756,27 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_f_i, __pyx_v_e_i, __pyx_v_f_span, __pyx_v_e_span, __pyx_v_nt, __pyx_v_al); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2059 + * + * # Substitute in non-terminals + * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<< + * f_sym = list(f_span[:]) + * off = f_i + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6 = {__Pyx_NAMESTR("lambda6"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; @@ -62455,7 +64790,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -62469,16 +64804,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda6") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda6") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -62491,25 +64826,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, __pyx_v_x, __pyx_v_y); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2047 - * - * # Substitute in non-terminals - * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<< - * f_sym = list(f_span[:]) - * off = f_i - */ - static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -62521,11 +64850,11 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda6", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __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[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __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); @@ -62533,15 +64862,14 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_cmp, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __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_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -62554,6 +64882,14 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2083 + * # Adjusting alignment links takes some doing + * links = [list(link) for sub in al for link in sub] + * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<< + * links_len = len(links) + * nt_len = len(nt) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7 = {__Pyx_NAMESTR("lambda7"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; @@ -62567,7 +64903,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -62581,16 +64917,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda7") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda7") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -62603,25 +64939,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, __pyx_v_x, __pyx_v_y); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2071 - * # Adjusting alignment links takes some doing - * links = [list(link) for sub in al for link in sub] - * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<< - * links_len = len(links) - * nt_len = len(nt) - */ - static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -62633,11 +64963,11 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda7", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __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[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __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); @@ -62645,15 +64975,14 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_cmp, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __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_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -62667,7 +64996,7 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self } static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2117 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<< @@ -62693,12 +65022,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2g __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -62737,19 +65067,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __Pyx_RaiseClosureNameError("links"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links) == Py_None)) { + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __Pyx_RaiseClosureNameError("links"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_links; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { 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++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #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 = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; @@ -62761,7 +65091,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -62774,16 +65104,15 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - { + } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; @@ -62791,7 +65120,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; @@ -62799,7 +65128,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); @@ -62810,10 +65139,10 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_j, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment->__pyx_vtab)->link(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment, __pyx_t_8, __pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment->__pyx_vtab)->link(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment, __pyx_t_8, __pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -62830,9 +65159,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -62850,7 +65181,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2044 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2056 * * # Create a rule from source, target, non-terminals, and alignments * def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<< @@ -62868,7 +65199,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_e_sym = NULL; PyObject *__pyx_v_links_inv = NULL; - PyObject *__pyx_v_links_len = NULL; + Py_ssize_t __pyx_v_links_len; PyObject *__pyx_v_nt_i = NULL; PyObject *__pyx_v_lex_f_i = NULL; PyObject *__pyx_v_lex_f_j = NULL; @@ -62907,52 +65238,52 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2047 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2059 * * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<< * f_sym = list(f_span[:]) * off = f_i */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __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 = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_nt); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nt); __Pyx_GIVEREF(__pyx_v_nt); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6, 0, __pyx_n_s_form_rule_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cmp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nt_inv = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2048 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2060 * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) # <<<<<<<<<<<<<< * off = f_i * for next_nt in nt: */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_f_span, 0, 0, NULL, NULL, &__pyx_k_slice_148, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_f_span, 0, 0, NULL, NULL, &__pyx_slice__72, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __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 = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); 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*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_f_sym = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2049 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2061 * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) * off = f_i # <<<<<<<<<<<<<< @@ -62962,7 +65293,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_f_i); __pyx_v_off = __pyx_v_f_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2050 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2062 * f_sym = list(f_span[:]) * off = f_i * for next_nt in nt: # <<<<<<<<<<<<<< @@ -62973,7 +65304,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_t_3 = __pyx_v_nt; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -62981,23 +65312,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63006,28 +65338,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2051 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2063 * off = f_i * for next_nt in nt: * nt_len = (next_nt[2] - next_nt[1]) + 1 # <<<<<<<<<<<<<< * i = 0 * while i < nt_len: */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2052 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2064 * for next_nt in nt: * nt_len = (next_nt[2] - next_nt[1]) + 1 * i = 0 # <<<<<<<<<<<<<< @@ -63037,7 +65369,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2053 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2065 * nt_len = (next_nt[2] - next_nt[1]) + 1 * i = 0 * while i < nt_len: # <<<<<<<<<<<<<< @@ -63045,110 +65377,103 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * i += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2054 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2066 * i = 0 * while i < nt_len: * f_sym.pop(next_nt[1] - off) # <<<<<<<<<<<<<< * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyList_PopIndex(__pyx_v_f_sym, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __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_6)); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2055 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2067 * while i < nt_len: * f_sym.pop(next_nt[1] - off) * i += 1 # <<<<<<<<<<<<<< * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_6); + __pyx_t_6 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2056 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2068 * f_sym.pop(next_nt[1] - off) * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<< * off += (nt_len - 1) * e_sym = list(e_span[:]) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2057 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2069 * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) # <<<<<<<<<<<<<< * e_sym = list(e_span[:]) * off = e_i */ - __pyx_t_6 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_6); + __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2058 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2070 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) * e_sym = list(e_span[:]) # <<<<<<<<<<<<<< * off = e_i * for next_nt in nt_inv: */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_e_span, 0, 0, NULL, NULL, &__pyx_k_slice_149, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_e_span, 0, 0, NULL, NULL, &__pyx_slice__73, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_e_sym = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2059 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2071 * off += (nt_len - 1) * e_sym = list(e_span[:]) * off = e_i # <<<<<<<<<<<<<< @@ -63158,7 +65483,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_e_i); __Pyx_DECREF_SET(__pyx_v_off, __pyx_v_e_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2060 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2072 * e_sym = list(e_span[:]) * off = e_i * for next_nt in nt_inv: # <<<<<<<<<<<<<< @@ -63169,7 +65494,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_t_3 = __pyx_v_nt_inv; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt_inv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt_inv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -63177,53 +65502,54 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { - __pyx_t_2 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_2)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_6); } - __Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_6); + __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2061 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2073 * off = e_i * for next_nt in nt_inv: * nt_len = (next_nt[4] - next_nt[3]) + 1 # <<<<<<<<<<<<<< * i = 0 * while i < nt_len: */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_6); - __pyx_t_6 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2062 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2074 * for next_nt in nt_inv: * nt_len = (next_nt[4] - next_nt[3]) + 1 * i = 0 # <<<<<<<<<<<<<< @@ -63233,7 +65559,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2063 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2075 * nt_len = (next_nt[4] - next_nt[3]) + 1 * i = 0 * while i < nt_len: # <<<<<<<<<<<<<< @@ -63241,82 +65567,75 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * i += 1 */ while (1) { - __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2064 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2076 * i = 0 * while i < nt_len: * e_sym.pop(next_nt[3] - off) # <<<<<<<<<<<<<< * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __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_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyList_PopIndex(__pyx_v_e_sym, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2065 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2077 * while i < nt_len: * e_sym.pop(next_nt[3] - off) * i += 1 # <<<<<<<<<<<<<< * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2066 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2078 * e_sym.pop(next_nt[3] - off) * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<< * off += (nt_len - 1) * */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2067 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2079 * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) # <<<<<<<<<<<<<< * * # Adjusting alignment links takes some doing */ - __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2); @@ -63324,20 +65643,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2070 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2082 * * # Adjusting alignment links takes some doing * links = [list(link) for sub in al for link in sub] # <<<<<<<<<<<<<< * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) * links_len = len(links) */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __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 = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyList_CheckExact(__pyx_v_al) || PyTuple_CheckExact(__pyx_v_al)) { __pyx_t_2 = __pyx_v_al; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_al); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_al); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -63345,23 +65664,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63373,7 +65693,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __pyx_t_1 = __pyx_v_sub; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -63381,23 +65701,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_6 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_6)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63405,83 +65726,80 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_link); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_link); __Pyx_GIVEREF(__pyx_v_link); - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_links = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2071 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2083 * # Adjusting alignment links takes some doing * links = [list(link) for sub in al for link in sub] * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<< * links_len = len(links) * nt_len = len(nt) */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __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 = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_links)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_links)); - __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_links)); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_links); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_links); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_links); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7, 0, __pyx_n_s_form_rule_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cmp, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_links_inv = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2072 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2084 * links = [list(link) for sub in al for link in sub] * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) * links_len = len(links) # <<<<<<<<<<<<<< * nt_len = len(nt) * nt_i = 0 */ - __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_links); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_links; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_links_len = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_links_len = __pyx_t_4; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2073 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2085 * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) * links_len = len(links) * nt_len = len(nt) # <<<<<<<<<<<<<< * nt_i = 0 * off = f_i */ - __pyx_t_4 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2074 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2086 * links_len = len(links) * nt_len = len(nt) * nt_i = 0 # <<<<<<<<<<<<<< @@ -63491,7 +65809,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __pyx_v_nt_i = __pyx_int_0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2075 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2087 * nt_len = len(nt) * nt_i = 0 * off = f_i # <<<<<<<<<<<<<< @@ -63501,7 +65819,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_f_i); __Pyx_DECREF_SET(__pyx_v_off, __pyx_v_f_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2076 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2088 * nt_i = 0 * off = f_i * i = 0 # <<<<<<<<<<<<<< @@ -63511,7 +65829,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2077 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2089 * off = f_i * i = 0 * while i < links_len: # <<<<<<<<<<<<<< @@ -63519,12 +65837,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * off += (nt[nt_i][2] - nt[nt_i][1]) */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_links_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__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 = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_7) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2078 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2090 * i = 0 * while i < links_len: * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: # <<<<<<<<<<<<<< @@ -63532,104 +65853,104 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * nt_i += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_7) { - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __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_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_14 = __pyx_t_13; } else { __pyx_t_14 = __pyx_t_7; } if (!__pyx_t_14) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2079 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2091 * while i < links_len: * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: * off += (nt[nt_i][2] - nt[nt_i][1]) # <<<<<<<<<<<<<< * nt_i += 1 * links[i][0] -= off */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __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_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __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; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __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_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2080 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2092 * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: * off += (nt[nt_i][2] - nt[nt_i][1]) * nt_i += 1 # <<<<<<<<<<<<<< * links[i][0] -= off * i += 1 */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_t_1); + __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2081 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2093 * off += (nt[nt_i][2] - nt[nt_i][1]) * nt_i += 1 * links[i][0] -= off # <<<<<<<<<<<<<< * i += 1 * nt_i = 0 */ - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_4, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_t_4, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2082 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2094 * nt_i += 1 * links[i][0] -= off * i += 1 # <<<<<<<<<<<<<< * nt_i = 0 * off = e_i */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2083 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2095 * links[i][0] -= off * i += 1 * nt_i = 0 # <<<<<<<<<<<<<< @@ -63639,7 +65960,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2084 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2096 * i += 1 * nt_i = 0 * off = e_i # <<<<<<<<<<<<<< @@ -63649,7 +65970,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_e_i); __Pyx_DECREF_SET(__pyx_v_off, __pyx_v_e_i); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2085 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2097 * nt_i = 0 * off = e_i * i = 0 # <<<<<<<<<<<<<< @@ -63659,7 +65980,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_i, __pyx_int_0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2086 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2098 * off = e_i * i = 0 * while i < links_len: # <<<<<<<<<<<<<< @@ -63667,12 +65988,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) */ while (1) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_links_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_i, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_14) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2087 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2099 * i = 0 * while i < links_len: * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: # <<<<<<<<<<<<<< @@ -63680,104 +66004,104 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * nt_i += 1 */ while (1) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_14) { - __pyx_t_2 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __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_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __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_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_13 = __pyx_t_7; } else { __pyx_t_13 = __pyx_t_14; } if (!__pyx_t_13) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2088 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2100 * while i < links_len: * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) # <<<<<<<<<<<<<< * nt_i += 1 * links_inv[i][1] -= off */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_off, __pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2089 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2101 * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) * nt_i += 1 # <<<<<<<<<<<<<< * links_inv[i][1] -= off * i += 1 */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_t_1); + __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2090 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2102 * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) * nt_i += 1 * links_inv[i][1] -= off # <<<<<<<<<<<<<< * i += 1 * */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 1; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_t_4, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetItemInt(__pyx_t_3, __pyx_t_4, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2091 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2103 * nt_i += 1 * links_inv[i][1] -= off * i += 1 # <<<<<<<<<<<<<< * * # Find lexical span */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2094 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2106 * * # Find lexical span * lex_f_i = f_i # <<<<<<<<<<<<<< @@ -63787,130 +66111,130 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_INCREF(__pyx_v_f_i); __pyx_v_lex_f_i = __pyx_v_f_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2095 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2107 * # Find lexical span * lex_f_i = f_i * lex_f_j = f_i + (len(f_span) - 1) # <<<<<<<<<<<<<< * if nt: * if nt[0][1] == lex_f_i: */ - __pyx_t_4 = PyObject_Length(__pyx_v_f_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Add(__pyx_v_f_i, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_v_f_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_lex_f_j = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_v_f_i, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_lex_f_j = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2096 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2108 * lex_f_i = f_i * lex_f_j = f_i + (len(f_span) - 1) * if nt: # <<<<<<<<<<<<<< * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 */ - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2097 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2109 * lex_f_j = f_i + (len(f_span) - 1) * if nt: * if nt[0][1] == lex_f_i: # <<<<<<<<<<<<<< * lex_f_i += (nt[0][2] - nt[0][1]) + 1 * if nt[-1][2] == lex_f_j: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __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_RichCompare(__pyx_t_3, __pyx_v_lex_f_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_lex_f_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2098 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2110 * if nt: * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 # <<<<<<<<<<<<<< * if nt[-1][2] == lex_f_j: * lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_lex_f_i, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_lex_f_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_lex_f_i, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_lex_f_i, __pyx_t_2); + __pyx_t_2 = 0; goto __pyx_L24; } __pyx_L24:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2099 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2111 * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 * if nt[-1][2] == lex_f_j: # <<<<<<<<<<<<<< * lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lex_f_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __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_RichCompare(__pyx_t_3, __pyx_v_lex_f_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_13) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2100 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2112 * lex_f_i += (nt[0][2] - nt[0][1]) + 1 * if nt[-1][2] == lex_f_j: * lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 # <<<<<<<<<<<<<< * * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __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_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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_InPlaceSubtract(__pyx_v_lex_f_j, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_lex_f_j, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_lex_f_j, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_lex_f_j, __pyx_t_2); + __pyx_t_2 = 0; goto __pyx_L25; } __pyx_L25:; @@ -63918,63 +66242,63 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s } __pyx_L23:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2103 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2115 * * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) * f = Phrase(f_sym) # <<<<<<<<<<<<<< * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __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 = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_f_sym); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_sym); + __Pyx_GIVEREF(__pyx_v_f_sym); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_f_sym)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f_sym)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_f_sym)); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2104 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2116 * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) * f = Phrase(f_sym) * e = Phrase(e_sym) # <<<<<<<<<<<<<< * a = tuple(self.alignment.link(i, j) for i, j in links) * return (f, e, a, lex_f_i, lex_f_j) */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_v_e_sym)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_e_sym)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_e_sym)); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __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 = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_v_e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_e_sym); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_e_sym); + __Pyx_GIVEREF(__pyx_v_e_sym); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_2); + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2117 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<< * return (f, e, a, lex_f_i, lex_f_j) * */ - __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __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[8]; __pyx_lineno = 2105; __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*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __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 = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_v_a = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_a = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2106 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2118 * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for i, j in links) * return (f, e, a, lex_f_i, lex_f_j) # <<<<<<<<<<<<<< @@ -63982,29 +66306,36 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s * # Rule string from rule */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_f)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_f)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f)); __Pyx_INCREF(((PyObject *)__pyx_v_e)); - PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_e)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_e)); __Pyx_GIVEREF(((PyObject *)__pyx_v_e)); - __Pyx_INCREF(((PyObject *)__pyx_v_a)); - PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_a)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_a)); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); __Pyx_INCREF(__pyx_v_lex_f_i); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_lex_f_i); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_lex_f_i); __Pyx_GIVEREF(__pyx_v_lex_f_i); __Pyx_INCREF(__pyx_v_lex_f_j); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_lex_f_j); + PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_lex_f_j); __Pyx_GIVEREF(__pyx_v_lex_f_j); - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2056 + * + * # Create a rule from source, target, non-terminals, and alignments + * def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<< + * + * # Substitute in non-terminals + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -64022,7 +66353,6 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_e_sym); __Pyx_XDECREF(__pyx_v_links_inv); - __Pyx_XDECREF(__pyx_v_links_len); __Pyx_XDECREF(__pyx_v_nt_i); __Pyx_XDECREF(__pyx_v_lex_f_i); __Pyx_XDECREF(__pyx_v_lex_f_j); @@ -64037,6 +66367,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2121 + * + * # Rule string from rule + * def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<< + * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) + * return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -64050,7 +66388,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fmt_rule (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__a,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_e,&__pyx_n_s_a,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -64065,21 +66403,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fmt_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fmt_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -64094,19 +66432,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.fmt_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_f, __pyx_v_e, __pyx_v_a); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2122 * # Rule string from rule * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<< @@ -64132,12 +66472,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_gen __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -64174,13 +66515,13 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_a; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -64188,23 +66529,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64214,27 +66556,27 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_packed, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_150), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment), __pyx_n_s__unlink); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment), __pyx_n_s_unlink); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_packed); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_packed); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_packed); - __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; __Pyx_XGIVEREF(__pyx_t_1); @@ -64252,9 +66594,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -64272,7 +66616,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2109 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2121 * * # Rule string from rule * def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<< @@ -64305,30 +66649,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2122 * # Rule string from rule * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<< * return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __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 = 2110; __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 = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__46, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __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; - __pyx_v_a_str = __pyx_t_2; + __pyx_v_a_str = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2111 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2123 * def fmt_rule(self, f, e, a): * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) * return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) # <<<<<<<<<<<<<< @@ -64336,29 +66672,36 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st * # Lookup online stats for phrase pair (f, e). Return None if no match. */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_151), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_X_0_1_2, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __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 = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_f); __Pyx_GIVEREF(__pyx_v_f); __Pyx_INCREF(__pyx_v_e); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_e); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_e); __Pyx_GIVEREF(__pyx_v_e); __Pyx_INCREF(__pyx_v_a_str); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_a_str); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_a_str); __Pyx_GIVEREF(__pyx_v_a_str); - __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 = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2121 + * + * # Rule string from rule + * def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<< + * a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) + * return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); @@ -64373,6 +66716,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2127 + * # Lookup online stats for phrase pair (f, e). Return None if no match. + * # IMPORTANT: use get() to avoid adding items to defaultdict + * def online_ctx_lookup(self, f, e, ctx_name=None): # <<<<<<<<<<<<<< + * if self.online: + * stats = self.online_stats[ctx_name] + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -64386,16 +66737,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("online_ctx_lookup (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__ctx_name,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_e,&__pyx_n_s_ctx_name,0}; PyObject* values[3] = {0,0,0}; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2115 - * # Lookup online stats for phrase pair (f, e). Return None if no match. - * # IMPORTANT: use get() to avoid adding items to defaultdict - * def online_ctx_lookup(self, f, e, ctx_name=None): # <<<<<<<<<<<<<< - * if self.online: - * stats = self.online_stats[ctx_name] - */ values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -64410,21 +66753,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ctx_name); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ctx_name); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "online_ctx_lookup") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "online_ctx_lookup") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -64441,13 +66784,15 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.online_ctx_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_lookup(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_f, __pyx_v_e, __pyx_v_ctx_name); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -64470,7 +66815,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("online_ctx_lookup", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2116 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2128 * # IMPORTANT: use get() to avoid adding items to defaultdict * def online_ctx_lookup(self, f, e, ctx_name=None): * if self.online: # <<<<<<<<<<<<<< @@ -64480,31 +66825,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __pyx_t_1 = (__pyx_v_self->online != 0); if (__pyx_t_1) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2117 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2129 * def online_ctx_lookup(self, f, e, ctx_name=None): * if self.online: * stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<< * fcount = stats.phrases_f.get(f, 0) * fsample_count = stats.samples_f.get(f, 0) */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_self->online_stats, __pyx_v_ctx_name); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_v_stats = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2118 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2130 * if self.online: * stats = self.online_stats[ctx_name] * fcount = stats.phrases_f.get(f, 0) # <<<<<<<<<<<<<< * fsample_count = stats.samples_f.get(f, 0) * d = stats.phrases_fe.get(f, None) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s_phrases_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __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 = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f); @@ -64512,26 +66857,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_fcount = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2119 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2131 * stats = self.online_stats[ctx_name] * fcount = stats.phrases_f.get(f, 0) * fsample_count = stats.samples_f.get(f, 0) # <<<<<<<<<<<<<< * d = stats.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s_samples_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f); @@ -64539,26 +66884,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_fsample_count = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2120 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2132 * fcount = stats.phrases_f.get(f, 0) * fsample_count = stats.samples_f.get(f, 0) * d = stats.phrases_fe.get(f, None) # <<<<<<<<<<<<<< * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s_phrases_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f); @@ -64566,25 +66911,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None); __Pyx_GIVEREF(Py_None); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __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_v_d = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2121 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2133 * fsample_count = stats.samples_f.get(f, 0) * d = stats.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 # <<<<<<<<<<<<<< * return OnlineFeatureContext(fcount, fsample_count, paircount) * return None */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_e); @@ -64592,10 +66937,10 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } else { @@ -64605,7 +66950,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __pyx_v_paircount = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2122 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2134 * d = stats.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount) # <<<<<<<<<<<<<< @@ -64613,9 +66958,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_152); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OnlineFeatureContext); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_fcount); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fcount); @@ -64626,18 +66971,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __Pyx_INCREF(__pyx_v_paircount); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_paircount); __Pyx_GIVEREF(__pyx_v_paircount); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __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_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2123 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2135 * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount) * return None # <<<<<<<<<<<<<< @@ -64649,8 +66992,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ __pyx_r = Py_None; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2127 + * # Lookup online stats for phrase pair (f, e). Return None if no match. + * # IMPORTANT: use get() to avoid adding items to defaultdict + * def online_ctx_lookup(self, f, e, ctx_name=None): # <<<<<<<<<<<<<< + * if self.online: + * stats = self.online_stats[ctx_name] + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); @@ -64669,6 +67019,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2140 + * # (Used for EGivenFCoherent) + * # Return set of (fphrase, lex_i, lex_j) + * def get_f_phrases(self, f_words): # <<<<<<<<<<<<<< + * + * f_len = len(f_words) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_34get_f_phrases(PyObject *__pyx_v_self, PyObject *__pyx_v_f_words); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_34get_f_phrases(PyObject *__pyx_v_self, PyObject *__pyx_v_f_words) { @@ -64676,10 +67034,20 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_34get_f_phras __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_f_phrases (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phrases(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_f_words)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2145 + * phrases = set() # (fphrase, lex_i, lex_j) + * + * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< + * # Phrase extraction limits + * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract = {__Pyx_NAMESTR("extract"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; @@ -64698,7 +67066,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f_i,&__pyx_n_s__f_j,&__pyx_n_s__lex_i,&__pyx_n_s__lex_j,&__pyx_n_s__wc,&__pyx_n_s__ntc,&__pyx_n_s__syms,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f_i,&__pyx_n_s_f_j,&__pyx_n_s_lex_i,&__pyx_n_s_lex_j,&__pyx_n_s_wc,&__pyx_n_s_ntc,&__pyx_n_s_syms,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -64717,41 +67085,41 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_i)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f_i)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_i)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lex_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_j)) != 0)) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lex_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--; + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wc)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ntc)) != 0)) kw_args--; + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ntc)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__syms)) != 0)) kw_args--; + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_syms)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -64774,25 +67142,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_f_phrases.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_self, __pyx_v_f_i, __pyx_v_f_j, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_v_ntc, __pyx_v_syms); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2133 - * phrases = set() # (fphrase, lex_i, lex_j) - * - * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< - * # Phrase extraction limits - * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(PyObject *__pyx_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_f_j, PyObject *__pyx_v_lex_i, PyObject *__pyx_v_lex_j, PyObject *__pyx_v_wc, PyObject *__pyx_v_ntc, PyObject *__pyx_v_syms) { struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_cur_scope; struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_outer_scope; @@ -64807,8 +67169,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; @@ -64818,33 +67180,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2135 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2147 * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<< * return * # Extend with word */ - if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t((__pyx_cur_scope->__pyx_v_f_len - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __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 = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) { - __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_t_5; } else { @@ -64852,7 +67213,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2136 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2148 * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: * return # <<<<<<<<<<<<<< @@ -64862,62 +67223,59 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L3; } - __pyx_L3:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2138 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2150 * return * # Extend with word * if wc + ntc < self.max_length: # <<<<<<<<<<<<<< * syms.append(f_words[f_j]) * f = Phrase(syms) */ - __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2139 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2151 * # Extend with word * if wc + ntc < self.max_length: * syms.append(f_words[f_j]) # <<<<<<<<<<<<<< * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_j); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2140 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2152 * if wc + ntc < self.max_length: * syms.append(f_words[f_j]) * f = Phrase(syms) # <<<<<<<<<<<<<< * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __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 = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_syms); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_syms); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_syms); __Pyx_GIVEREF(__pyx_v_syms); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_2); + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2141 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2153 * syms.append(f_words[f_j]) * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) # <<<<<<<<<<<<<< @@ -64925,28 +67283,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras * phrases.add((f, new_lex_i, new_lex_j)) */ __Pyx_INCREF(__pyx_v_f_j); - __pyx_t_1 = __pyx_v_f_j; + __pyx_t_2 = __pyx_v_f_j; __Pyx_INCREF(__pyx_v_lex_i); - __pyx_t_2 = __pyx_v_lex_i; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __pyx_v_lex_i; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = __pyx_t_1; - } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_t_2; + } else { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = __pyx_t_1; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_t_4; - __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_t_4; + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_new_lex_i = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_new_lex_i = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2142 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2154 * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) # <<<<<<<<<<<<<< @@ -64954,97 +67312,97 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) */ __Pyx_INCREF(__pyx_v_f_j); - __pyx_t_1 = __pyx_v_f_j; + __pyx_t_2 = __pyx_v_f_j; __Pyx_INCREF(__pyx_v_lex_j); __pyx_t_4 = __pyx_v_lex_j; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = __pyx_t_1; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; } else { __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; + __pyx_t_1 = __pyx_t_4; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_new_lex_j = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_2 = __pyx_t_1; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_new_lex_j = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2143 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2155 * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) * phrases.add((f, new_lex_i, new_lex_j)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) * syms.pop() */ - if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_phrases) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_phrases == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __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[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_f)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_f)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f)); __Pyx_INCREF(__pyx_v_new_lex_i); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_new_lex_i); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_new_lex_i); __Pyx_GIVEREF(__pyx_v_new_lex_i); __Pyx_INCREF(__pyx_v_new_lex_j); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_new_lex_j); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_new_lex_j); __Pyx_GIVEREF(__pyx_v_new_lex_j); - __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_t_7 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2144 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2156 * new_lex_j = max(lex_j, f_j) * phrases.add((f, new_lex_i, new_lex_j)) * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) # <<<<<<<<<<<<<< * syms.pop() * # Extend with existing non-terminal */ - __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_lex_i, __pyx_v_new_lex_j, __pyx_t_2, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_2, __pyx_v_new_lex_i, __pyx_v_new_lex_j, __pyx_t_1, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2157 * phrases.add((f, new_lex_i, new_lex_j)) * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) * syms.pop() # <<<<<<<<<<<<<< * # Extend with existing non-terminal * if syms and sym_isvar(syms[-1]): */ - __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4; } __pyx_L4:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2147 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2159 * syms.pop() * # Extend with existing non-terminal * if syms and sym_isvar(syms[-1]): # <<<<<<<<<<<<<< * # Don't re-extract the same phrase * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_9) != 0); } else { @@ -65052,62 +67410,64 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2149 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2161 * if syms and sym_isvar(syms[-1]): * # Don't re-extract the same phrase * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) # <<<<<<<<<<<<<< * # Extend with new non-terminal * if wc + ntc < self.max_length: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L5; } __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2151 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2163 * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) * # Extend with new non-terminal * if wc + ntc < self.max_length: # <<<<<<<<<<<<<< * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): * syms.append(sym_setindex(self.category, ntc + 1)) */ - __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2152 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2164 * # Extend with new non-terminal * if wc + ntc < self.max_length: * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): # <<<<<<<<<<<<<< * syms.append(sym_setindex(self.category, ntc + 1)) * f = Phrase(syms) */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (!__pyx_t_3); if (!__pyx_t_6) { - __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_9) != 0)); __pyx_t_10 = __pyx_t_5; @@ -65120,111 +67480,110 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2153 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2165 * if wc + ntc < self.max_length: * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): * syms.append(sym_setindex(self.category, ntc + 1)) # <<<<<<<<<<<<<< * f = Phrase(syms) * if wc > 0: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2154 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2166 * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): * syms.append(sym_setindex(self.category, ntc + 1)) * f = Phrase(syms) # <<<<<<<<<<<<<< * if wc > 0: * phrases.add((f, lex_i, lex_j)) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __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[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_syms); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_syms); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_syms); __Pyx_GIVEREF(__pyx_v_syms); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_f, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_4)); - __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_f, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_2)); + __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2155 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2167 * syms.append(sym_setindex(self.category, ntc + 1)) * f = Phrase(syms) * if wc > 0: # <<<<<<<<<<<<<< * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2167; __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 = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2156 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2168 * f = Phrase(syms) * if wc > 0: * phrases.add((f, lex_i, lex_j)) # <<<<<<<<<<<<<< * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) * syms.pop() */ - if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_phrases) == Py_None)) { + if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(__pyx_cur_scope->__pyx_v_phrases == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_f)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_f)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_f)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f)); __Pyx_INCREF(__pyx_v_lex_i); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_lex_i); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lex_i); __Pyx_GIVEREF(__pyx_v_lex_i); __Pyx_INCREF(__pyx_v_lex_j); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_lex_j); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_lex_j); __Pyx_GIVEREF(__pyx_v_lex_j); - __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_7 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L8; } __pyx_L8:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2157 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2169 * if wc > 0: * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) # <<<<<<<<<<<<<< * syms.pop() * */ - __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_2, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_t_4, __pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_t_1, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2158 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2170 * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) * syms.pop() # <<<<<<<<<<<<<< * * # Try to extract phrases from every f index */ - __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L7; } __pyx_L7:; @@ -65232,13 +67591,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras } __pyx_L6:; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2145 + * phrases = set() # (fphrase, lex_i, lex_j) + * + * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< + * # Phrase extraction limits + * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: + */ + + /* function exit code */ __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_4); - __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_f_phrases.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -65250,7 +67618,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2128 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2140 * # (Used for EGivenFCoherent) * # Return set of (fphrase, lex_i, lex_j) * def get_f_phrases(self, f_words): # <<<<<<<<<<<<<< @@ -65265,11 +67633,10 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; - long __pyx_t_3; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -65287,7 +67654,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2130 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2142 * def get_f_phrases(self, f_words): * * f_len = len(f_words) # <<<<<<<<<<<<<< @@ -65296,75 +67663,71 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_f_words; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __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[8]; __pyx_lineno = 2142; __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[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v_f_len = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_cur_scope->__pyx_v_f_len = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2131 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2143 * * f_len = len(f_words) * phrases = set() # (fphrase, lex_i, lex_j) # <<<<<<<<<<<<<< * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_phrases = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2133 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2145 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, __pyx_n_s_155, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_154)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, __pyx_n_s_get_f_phrases_locals_extract, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cdec_sa__sa, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2161 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2173 * * # Try to extract phrases from every f index * for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<< * extract(f_i, f_i, f_len, -1, 0, 0, []) * */ - __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_3; __pyx_v_f_i++) { + __pyx_t_2 = __pyx_cur_scope->__pyx_v_f_len; + for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_2; __pyx_v_f_i++) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2162 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2174 * # Try to extract phrases from every f index * for f_i from 0 <= f_i < f_len: * extract(f_i, f_i, f_len, -1, 0, 0, []) # <<<<<<<<<<<<<< * * return phrases */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_f_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_f_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __pyx_cur_scope->__pyx_v_f_len; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_3, __pyx_t_4, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2164 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2176 * extract(f_i, f_i, f_len, -1, 0, 0, []) * * return phrases # <<<<<<<<<<<<<< @@ -65372,18 +67735,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras * # Drop online stats for a context */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrases)); - __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_phrases); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrases); + __pyx_r = __pyx_cur_scope->__pyx_v_phrases; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2140 + * # (Used for EGivenFCoherent) + * # Return set of (fphrase, lex_i, lex_j) + * def get_f_phrases(self, f_words): # <<<<<<<<<<<<<< + * + * f_len = len(f_words) + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_f_phrases", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -65393,6 +67763,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2179 + * + * # Drop online stats for a context + * def drop_ctx(self, ctx_name=None): # <<<<<<<<<<<<<< + * self.online_stats.pop(ctx_name, None) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -65404,16 +67782,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("drop_ctx (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ctx_name,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctx_name,0}; PyObject* values[1] = {0}; - - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2167 - * - * # Drop online stats for a context - * def drop_ctx(self, ctx_name=None): # <<<<<<<<<<<<<< - * self.online_stats.pop(ctx_name, None) - * - */ values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -65427,12 +67797,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py switch (pos_args) { case 0: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ctx_name); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ctx_name); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drop_ctx") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drop_ctx") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -65445,13 +67815,15 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("drop_ctx", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("drop_ctx", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.drop_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_ctx_name); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -65467,16 +67839,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("drop_ctx", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2180 * # Drop online stats for a context * def drop_ctx(self, ctx_name=None): * self.online_stats.pop(ctx_name, None) # <<<<<<<<<<<<<< * * # Spans are _inclusive_ on both ends [i, j] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->online_stats, __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->online_stats, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __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 = 2168; __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 = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ctx_name); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ctx_name); @@ -65484,12 +67856,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); __Pyx_GIVEREF(Py_None); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2179 + * + * # Drop online stats for a context + * def drop_ctx(self, ctx_name=None): # <<<<<<<<<<<<<< + * self.online_stats.pop(ctx_name, None) + * + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -65504,6 +67885,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2183 + * + * # Spans are _inclusive_ on both ends [i, j] + * def span_check(vec, i, j): # <<<<<<<<<<<<<< + * k = i + * while k <= j: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_17span_check = {__Pyx_NAMESTR("span_check"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_17span_check, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; @@ -65518,7 +67907,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("span_check (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vec,&__pyx_n_s__i,&__pyx_n_s__j,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_i,&__pyx_n_s_j,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -65533,21 +67922,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vec)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_check") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_check") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -65562,25 +67951,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.span_check", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_16span_check(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171 - * - * # Spans are _inclusive_ on both ends [i, j] - * def span_check(vec, i, j): # <<<<<<<<<<<<<< - * k = i - * while k <= j: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) { PyObject *__pyx_v_k = NULL; PyObject *__pyx_r = NULL; @@ -65592,7 +67975,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_check", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2172 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2184 * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -65602,7 +67985,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2185 * def span_check(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -65610,25 +67993,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ * return False */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __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[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __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[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2174 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2186 * k = i * while k <= j: * if vec[k]: # <<<<<<<<<<<<<< * return False * k += 1 */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_vec, __pyx_v_k); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_vec, __pyx_v_k); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __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[8]; __pyx_lineno = 2174; __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[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2175 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2187 * while k <= j: * if vec[k]: * return False # <<<<<<<<<<<<<< @@ -65636,29 +68019,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ * return True */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - goto __pyx_L5; } - __pyx_L5:; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2176 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2188 * if vec[k]: * return False * k += 1 # <<<<<<<<<<<<<< * return True * */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2177 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2189 * return False * k += 1 * return True # <<<<<<<<<<<<<< @@ -65666,14 +68045,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ * def span_inc(vec, i, j): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2183 + * + * # Spans are _inclusive_ on both ends [i, j] + * def span_check(vec, i, j): # <<<<<<<<<<<<<< + * k = i + * while k <= j: + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cdec.sa._sa.span_check", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -65685,6 +68069,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__ return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2191 + * return True + * + * def span_inc(vec, i, j): # <<<<<<<<<<<<<< + * k = i + * while k <= j: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_19span_inc = {__Pyx_NAMESTR("span_inc"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_19span_inc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; @@ -65699,7 +68091,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("span_inc (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vec,&__pyx_n_s__i,&__pyx_n_s__j,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_i,&__pyx_n_s_j,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -65714,21 +68106,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vec)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_inc") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_inc") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -65743,25 +68135,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.span_inc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_18span_inc(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179 - * return True - * - * def span_inc(vec, i, j): # <<<<<<<<<<<<<< - * k = i - * while k <= j: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) { PyObject *__pyx_v_k = NULL; PyObject *__pyx_r = NULL; @@ -65775,7 +68161,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_inc", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2180 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2192 * * def span_inc(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -65785,7 +68171,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2181 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2193 * def span_inc(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -65793,12 +68179,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py * k += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __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[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __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[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2182 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2194 * k = i * while k <= j: * vec[k] += 1 # <<<<<<<<<<<<<< @@ -65807,28 +68193,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py */ __Pyx_INCREF(__pyx_v_k); __pyx_t_1 = __pyx_v_k; - __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2183 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2195 * while k <= j: * vec[k] += 1 * k += 1 # <<<<<<<<<<<<<< * * def span_dec(vec, i, j): */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2191 + * return True + * + * def span_inc(vec, i, j): # <<<<<<<<<<<<<< + * k = i + * while k <= j: + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -65844,6 +68239,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2197 + * k += 1 + * + * def span_dec(vec, i, j): # <<<<<<<<<<<<<< + * k = i + * while k <= j: + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_21span_dec = {__Pyx_NAMESTR("span_dec"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_21span_dec, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; @@ -65858,7 +68261,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("span_dec (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vec,&__pyx_n_s__i,&__pyx_n_s__j,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_i,&__pyx_n_s_j,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -65873,21 +68276,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vec)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_dec") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_dec") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -65902,25 +68305,19 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cdec.sa._sa.span_dec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_20span_dec(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185 - * k += 1 - * - * def span_dec(vec, i, j): # <<<<<<<<<<<<<< - * k = i - * while k <= j: - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) { PyObject *__pyx_v_k = NULL; PyObject *__pyx_r = NULL; @@ -65934,7 +68331,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_dec", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2186 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2198 * * def span_dec(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -65944,7 +68341,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2187 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2199 * def span_dec(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -65952,12 +68349,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py * k += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __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[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2199; __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[8]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2188 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2200 * k = i * while k <= j: * vec[k] -= 1 # <<<<<<<<<<<<<< @@ -65965,26 +68362,35 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py */ __Pyx_INCREF(__pyx_v_k); __pyx_t_1 = __pyx_v_k; - __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2189 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2201 * while k <= j: * vec[k] -= 1 * k += 1 # <<<<<<<<<<<<<< */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; } + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2197 + * k += 1 + * + * def span_dec(vec, i, j): # <<<<<<<<<<<<<< + * k = i + * while k <= j: + */ + + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -66000,6 +68406,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":7 + * + * cdef class FeatureVector: + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.names = IntList(INITIAL_CAPACITY, INCREMENT) + * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_13FeatureVector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_13FeatureVector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -66010,18 +68424,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_13FeatureVector_1__cinit__(PyObject *__pyx_v_ __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_4cdec_2sa_3_sa_13FeatureVector___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":7 - * - * cdef class FeatureVector: - * def __cinit__(self): # <<<<<<<<<<<<<< - * self.names = IntList(INITIAL_CAPACITY, INCREMENT) - * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) - */ - static int __pyx_pf_4cdec_2sa_3_sa_13FeatureVector___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations @@ -66033,16 +68441,16 @@ static int __pyx_pf_4cdec_2sa_3_sa_13FeatureVector___cinit__(struct __pyx_obj_4c int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":8 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":8 * cdef class FeatureVector: * def __cinit__(self): * self.names = IntList(INITIAL_CAPACITY, INCREMENT) # <<<<<<<<<<<<<< * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__INITIAL_CAPACITY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_INITIAL_CAPACITY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__INCREMENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_INCREMENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; __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[13]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -66052,25 +68460,25 @@ static int __pyx_pf_4cdec_2sa_3_sa_13FeatureVector___cinit__(struct __pyx_obj_4c __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; __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_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->names); __Pyx_DECREF(((PyObject *)__pyx_v_self->names)); __pyx_v_self->names = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":9 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":9 * def __cinit__(self): * self.names = IntList(INITIAL_CAPACITY, INCREMENT) * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) # <<<<<<<<<<<<<< * * def set(self, unsigned name, float value): */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__INITIAL_CAPACITY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_INITIAL_CAPACITY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__INCREMENT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_INCREMENT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -66080,15 +68488,24 @@ static int __pyx_pf_4cdec_2sa_3_sa_13FeatureVector___cinit__(struct __pyx_obj_4c __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FloatList)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->values); __Pyx_DECREF(((PyObject *)__pyx_v_self->values)); __pyx_v_self->values = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_3); __pyx_t_3 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":7 + * + * cdef class FeatureVector: + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.names = IntList(INITIAL_CAPACITY, INCREMENT) + * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -66102,6 +68519,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_13FeatureVector___cinit__(struct __pyx_obj_4c return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":11 + * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) + * + * def set(self, unsigned name, float value): # <<<<<<<<<<<<<< + * self.names.append(name) + * self.values.append(value) + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_3set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_3set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -66114,7 +68539,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_3set(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__value,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -66128,10 +68553,10 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_3set(PyObject *__pyx_v_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -66145,7 +68570,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_3set(PyObject *__pyx_v_ values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_name = __Pyx_PyInt_AsUnsignedInt(values[0]); if (unlikely((__pyx_v_name == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_name = __Pyx_PyInt_As_unsigned_int(values[0]); if (unlikely((__pyx_v_name == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_value = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_value == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; @@ -66157,61 +68582,59 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_3set(PyObject *__pyx_v_ return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_13FeatureVector_2set(((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_v_self), __pyx_v_name, __pyx_v_value); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":11 - * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) - * - * def set(self, unsigned name, float value): # <<<<<<<<<<<<<< - * self.names.append(name) - * self.values.append(value) - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_2set(struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_v_self, unsigned int __pyx_v_name, float __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; + int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":12 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":12 * * def set(self, unsigned name, float value): * self.names.append(name) # <<<<<<<<<<<<<< * self.values.append(value) * */ - __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_name); 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_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->names), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->names), __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":13 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":13 * def set(self, unsigned name, float value): * self.names.append(name) * self.values.append(value) # <<<<<<<<<<<<<< * * def __iter__(self): */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->values), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->values), __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":11 + * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) + * + * def set(self, unsigned name, float value): # <<<<<<<<<<<<<< + * self.names.append(name) + * self.values.append(value) + */ + + /* function exit code */ __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_AddTraceback("cdec.sa._sa.FeatureVector.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -66221,6 +68644,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_2set(struct __pyx_obj_4 } static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":15 + * self.values.append(value) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef unsigned i + * for i in range(self.names.len): + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_5__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_5__iter__(PyObject *__pyx_v_self) { @@ -66228,18 +68659,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_5__iter__(PyObject *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_13FeatureVector_4__iter__(((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":15 - * self.values.append(value) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * cdef unsigned i - * for i in range(self.names.len): - */ - static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_4__iter__(struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_v_self) { struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; @@ -66264,6 +68689,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_4__iter__(struct __pyx_ return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -66301,7 +68727,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_Gener __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":17 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":17 * def __iter__(self): * cdef unsigned i * for i in range(self.names.len): # <<<<<<<<<<<<<< @@ -66312,30 +68738,30 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_Gener for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_2; - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":18 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":18 * cdef unsigned i * for i in range(self.names.len): * yield (FD.word(self.names[i]), self.values[i]) # <<<<<<<<<<<<<< * * def __str__(self): */ - __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->names), __pyx_cur_scope->__pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->names), __pyx_cur_scope->__pyx_v_i, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __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[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyBytes_FromString(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *)__pyx_v_4cdec_2sa_3_sa_FD->__pyx_vtab)->word(__pyx_v_4cdec_2sa_3_sa_FD, __pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->values), __pyx_cur_scope->__pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->values), __pyx_cur_scope->__pyx_v_i, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __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[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_5 = 0; - __pyx_r = ((PyObject *)__pyx_t_6); + __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; @@ -66349,6 +68775,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_Gener __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":15 + * self.values.append(value) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef unsigned i + * for i in range(self.names.len): + */ + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -66364,6 +68800,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_Gener return NULL; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":20 + * yield (FD.word(self.names[i]), self.values[i]) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return ' '.join('%s=%s' % feat for feat in self) + * + */ + /* Python wrapper */ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_8__str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_8__str__(PyObject *__pyx_v_self) { @@ -66371,12 +68815,14 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_8__str__(PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_r = __pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_v_self)); + + /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":21 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":21 * * def __str__(self): * return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<< @@ -66408,6 +68854,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str___genexpr(PyObje return (PyObject *) gen; } + /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; @@ -66469,8 +68916,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17(_ } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -66481,9 +68929,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17(_ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_feat, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_156), __pyx_cur_scope->__pyx_v_feat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_r = ((PyObject *)__pyx_t_4); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_cur_scope->__pyx_v_feat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; @@ -66503,6 +68951,8 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17(_ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; @@ -66517,7 +68967,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17(_ return NULL; } -/* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":20 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":20 * yield (FD.word(self.names[i]), self.values[i]) * * def __str__(self): # <<<<<<<<<<<<<< @@ -66531,7 +68981,6 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(struct __pyx_o __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -66546,7 +68995,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(struct __pyx_o __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":21 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":21 * * def __str__(self): * return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<< @@ -66554,29 +69003,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(struct __pyx_o * cdef class Scorer: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str___genexpr(((PyObject*)__pyx_cur_scope)); 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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __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[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__46, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":20 + * yield (FD.word(self.names[i]), self.values[i]) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return ' '.join('%s=%s' % feat for feat in self) + * + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cdec.sa._sa.FeatureVector.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -66586,6 +69033,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(struct __pyx_o return __pyx_r; } +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":25 + * cdef class Scorer: + * cdef models + * def __init__(self, *models): # <<<<<<<<<<<<<< + * names = [FD.index(model.__name__) for model in models] + * self.models = zip(names, models) + */ + /* Python wrapper */ static int __pyx_pw_4cdec_2sa_3_sa_6Scorer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4cdec_2sa_3_sa_6Scorer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -66597,19 +69052,13 @@ static int __pyx_pw_4cdec_2sa_3_sa_6Scorer_1__init__(PyObject *__pyx_v_self, PyO __Pyx_INCREF(__pyx_args); __pyx_v_models = __pyx_args; __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(((struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)__pyx_v_self), __pyx_v_models); + + /* function exit code */ __Pyx_XDECREF(__pyx_v_models); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":25 - * cdef class Scorer: - * cdef models - * def __init__(self, *models): # <<<<<<<<<<<<<< - * names = [FD.index(model.__name__) for model in models] - * self.models = zip(names, models) - */ - static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3_sa_Scorer *__pyx_v_self, PyObject *__pyx_v_models) { PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_model = NULL; @@ -66625,7 +69074,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":26 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":26 * cdef models * def __init__(self, *models): * names = [FD.index(model.__name__) for model in models] # <<<<<<<<<<<<<< @@ -66634,7 +69083,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3 */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((PyObject *)__pyx_v_models); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_2 = __pyx_v_models; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON @@ -66644,11 +69093,11 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3 #endif __Pyx_XDECREF_SET(__pyx_v_model, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_model, __pyx_n_s____name__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_model, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *)__pyx_v_4cdec_2sa_3_sa_FD->__pyx_vtab)->index(__pyx_v_4cdec_2sa_3_sa_FD, ((char *)__pyx_t_5))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *)__pyx_v_4cdec_2sa_3_sa_FD->__pyx_vtab)->index(__pyx_v_4cdec_2sa_3_sa_FD, ((char *)__pyx_t_5))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -66657,7 +69106,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3 __pyx_v_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":27 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":27 * def __init__(self, *models): * names = [FD.index(model.__name__) for model in models] * self.models = zip(names, models) # <<<<<<<<<<<<<< @@ -66666,21 +69115,30 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3 */ __pyx_t_1 = PyTuple_New(2); 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_INCREF(((PyObject *)__pyx_v_names)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_names)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_names)); - __Pyx_INCREF(((PyObject *)__pyx_v_models)); - PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_models)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_models)); - __pyx_t_2 = PyObject_Call(__pyx_builtin_zip, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(__pyx_v_names); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_names); + __Pyx_GIVEREF(__pyx_v_names); + __Pyx_INCREF(__pyx_v_models); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_models); + __Pyx_GIVEREF(__pyx_v_models); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); 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_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->models); __Pyx_DECREF(__pyx_v_self->models); __pyx_v_self->models = __pyx_t_2; __pyx_t_2 = 0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":25 + * cdef class Scorer: + * cdef models + * def __init__(self, *models): # <<<<<<<<<<<<<< + * names = [FD.index(model.__name__) for model in models] + * self.models = zip(names, models) + */ + + /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; @@ -66696,7 +69154,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3 return __pyx_r; } -/* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":29 +/* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":29 * self.models = zip(names, models) * * cdef FeatureVector score(self, ctx): # <<<<<<<<<<<<<< @@ -66723,19 +69181,19 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("score", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":30 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":30 * * cdef FeatureVector score(self, ctx): * cdef FeatureVector scores = FeatureVector() # <<<<<<<<<<<<<< * for name, model in self.models: * scores.set(name, model(ctx)) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FeatureVector)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_FeatureVector)), __pyx_empty_tuple, NULL); 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_v_scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":31 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":31 * cdef FeatureVector score(self, ctx): * cdef FeatureVector scores = FeatureVector() * for name, model in self.models: # <<<<<<<<<<<<<< @@ -66768,8 +69226,9 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; @@ -66805,8 +69264,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc __Pyx_GOTREF(__pyx_t_6); #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[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -66832,22 +69290,22 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc __Pyx_XDECREF_SET(__pyx_v_model, __pyx_t_6); __pyx_t_6 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":32 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":32 * cdef FeatureVector scores = FeatureVector() * for name, model in self.models: * scores.set(name, model(ctx)) # <<<<<<<<<<<<<< * return scores */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scores), __pyx_n_s__set); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scores), __pyx_n_s_set); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_ctx); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ctx); __Pyx_GIVEREF(__pyx_v_ctx); - __pyx_t_5 = PyObject_Call(__pyx_v_model, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_model, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_name); @@ -66856,15 +69314,15 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 32; __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_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":33 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":33 * for name, model in self.models: * scores.set(name, model(ctx)) * return scores # <<<<<<<<<<<<<< @@ -66874,8 +69332,15 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc __pyx_r = __pyx_v_scores; goto __pyx_L0; - __pyx_r = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/features.pxi":29 + * self.models = zip(names, models) + * + * cdef FeatureVector score(self, ctx): # <<<<<<<<<<<<<< + * cdef FeatureVector scores = FeatureVector() + * for name, model in self.models: + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); @@ -66892,11 +69357,298 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc __Pyx_RefNannyFinishContext(); return __pyx_r; } +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList __pyx_vtable_4cdec_2sa_3_sa_FloatList; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_FloatList(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_FloatList *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_FloatList; + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_9FloatList_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_FloatList(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_4cdec_2sa_3_sa_9FloatList_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_4cdec_2sa_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_4cdec_2sa_3_sa_FloatList(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_9FloatList_7__setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_FloatList[] = { + {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9FloatList_11append, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9FloatList_13write, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9FloatList_15read, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_FloatList = { + __pyx_pw_4cdec_2sa_3_sa_9FloatList_9__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_4cdec_2sa_3_sa_FloatList, /*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_FloatList = { + __pyx_pw_4cdec_2sa_3_sa_9FloatList_9__len__, /*mp_length*/ + __pyx_pw_4cdec_2sa_3_sa_9FloatList_5__getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_4cdec_2sa_3_sa_FloatList, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_FloatList = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cdec.sa._sa.FloatList"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_FloatList), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_FloatList, /*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*/ + 0, /*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*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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*/ + 0, /*tp_iternext*/ + __pyx_methods_4cdec_2sa_3_sa_FloatList, /*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_4cdec_2sa_3_sa_FloatList, /*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 + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList __pyx_vtable_4cdec_2sa_3_sa_IntList; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_IntList(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_IntList *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_IntList; + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_7IntList_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_IntList(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_4cdec_2sa_3_sa_7IntList_15__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_4cdec_2sa_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_mp_ass_subscript_4cdec_2sa_3_sa_IntList(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_7IntList_22__setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_IntList[] = { + {__Pyx_NAMESTR("index"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_5index, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("partition"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_7partition, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_doquicksort"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_9_doquicksort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sort"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_11sort, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_13reset, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_size"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_26get_size, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_28append, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("extend"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_30extend, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_32write, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_34read, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_IntList = { + __pyx_pw_4cdec_2sa_3_sa_7IntList_24__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_4cdec_2sa_3_sa_IntList, /*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_IntList = { + __pyx_pw_4cdec_2sa_3_sa_7IntList_24__len__, /*mp_length*/ + __pyx_pw_4cdec_2sa_3_sa_7IntList_20__getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_4cdec_2sa_3_sa_IntList, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_IntList = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cdec.sa._sa.IntList"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_IntList), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_IntList, /*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*/ + 0, /*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*/ + __pyx_pw_4cdec_2sa_3_sa_7IntList_3__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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_4cdec_2sa_3_sa_7IntList_17__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4cdec_2sa_3_sa_IntList, /*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_4cdec_2sa_3_sa_IntList, /*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 + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_FeatureVector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *p; PyObject *o; - o = (*t->tp_alloc)(t, 0); + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)o); p->names = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); @@ -66909,6 +69661,11 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_FeatureVector(PyTypeObject *t, CYTH static void __pyx_tp_dealloc_4cdec_2sa_3_sa_FeatureVector(PyObject *o) { struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *p = (struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->names); Py_CLEAR(p->values); @@ -66928,8 +69685,8 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa_FeatureVector(PyObject *o, visitproc } static int __pyx_tp_clear_4cdec_2sa_3_sa_FeatureVector(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *p = (struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)o; PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *p = (struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)o; tmp = ((PyObject*)p->names); p->names = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -66998,67 +69755,46 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_FeatureVector = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_SuffixArray __pyx_vtable_4cdec_2sa_3_sa_SuffixArray; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase __pyx_vtable_4cdec_2sa_3_sa_Phrase; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_SuffixArray(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Phrase(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_Phrase *p; PyObject *o; - o = (*t->tp_alloc)(t, 0); + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_SuffixArray; - p->darray = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); - p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->ha = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_1__cinit__(o, a, k) < 0)) { + p = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_Phrase; + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_6Phrase_1__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_SuffixArray(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->darray); - Py_CLEAR(p->sa); - Py_CLEAR(p->ha); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_4cdec_2sa_3_sa_SuffixArray(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)o; - if (p->darray) { - e = (*v)(((PyObject*)p->darray), a); if (e) return e; - } - if (p->sa) { - e = (*v)(((PyObject*)p->sa), a); if (e) return e; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Phrase(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } - if (p->ha) { - e = (*v)(((PyObject*)p->ha), a); if (e) return e; + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_4cdec_2sa_3_sa_6Phrase_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); } - return 0; -} - -static int __pyx_tp_clear_4cdec_2sa_3_sa_SuffixArray(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)o; - PyObject* tmp; - tmp = ((PyObject*)p->darray); - p->darray = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->sa); - p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->ha); - p->ha = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; + (*Py_TYPE(o)->tp_free)(o); } -static PyObject *__pyx_sq_item_4cdec_2sa_3_sa_SuffixArray(PyObject *o, Py_ssize_t i) { +static PyObject *__pyx_sq_item_4cdec_2sa_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); @@ -67066,22 +69802,32 @@ static PyObject *__pyx_sq_item_4cdec_2sa_3_sa_SuffixArray(PyObject *o, Py_ssize_ return r; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_SuffixArray[] = { - {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_5read_text, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_11SuffixArray_4read_text)}, - {__Pyx_NAMESTR("q3sort"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_7q3sort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_11SuffixArray_6q3sort)}, - {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_9write_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_11read_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_13write_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_15write_enhanced, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_17lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_6Phrase_words(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_6Phrase_5words_1__get__(o); +} + +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Phrase[] = { + {__Pyx_NAMESTR("handle"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_7handle, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_6Phrase_6handle)}, + {__Pyx_NAMESTR("strhandle"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_9strhandle, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("arity"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_11arity, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getvarpos"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_13getvarpos, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getvar"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_15getvar, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("clen"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_17clen, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getchunk"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_19getchunk, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("subst"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_32subst, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PySequenceMethods __pyx_tp_as_sequence_SuffixArray = { - 0, /*sq_length*/ +static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_Phrase[] = { + {(char *)"words", __pyx_getprop_4cdec_2sa_3_sa_6Phrase_words, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_Phrase = { + __pyx_pw_4cdec_2sa_3_sa_6Phrase_25__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ - __pyx_sq_item_4cdec_2sa_3_sa_SuffixArray, /*sq_item*/ + __pyx_sq_item_4cdec_2sa_3_sa_Phrase, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ @@ -67090,47 +69836,47 @@ static PySequenceMethods __pyx_tp_as_sequence_SuffixArray = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_SuffixArray = { - 0, /*mp_length*/ - __pyx_pw_4cdec_2sa_3_sa_11SuffixArray_3__getitem__, /*mp_subscript*/ +static PyMappingMethods __pyx_tp_as_mapping_Phrase = { + __pyx_pw_4cdec_2sa_3_sa_6Phrase_25__len__, /*mp_length*/ + __pyx_pw_4cdec_2sa_3_sa_6Phrase_27__getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_SuffixArray = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Phrase = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.SuffixArray"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.Phrase"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Phrase), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_SuffixArray, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_Phrase, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ + __pyx_pw_4cdec_2sa_3_sa_6Phrase_21__cmp__, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_SuffixArray, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_SuffixArray, /*tp_as_mapping*/ - 0, /*tp_hash*/ + &__pyx_tp_as_sequence_Phrase, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Phrase, /*tp_as_mapping*/ + __pyx_pw_4cdec_2sa_3_sa_6Phrase_23__hash__, /*tp_hash*/ 0, /*tp_call*/ - 0, /*tp_str*/ + __pyx_pw_4cdec_2sa_3_sa_6Phrase_5__str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_SuffixArray, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_SuffixArray, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ + __pyx_pw_4cdec_2sa_3_sa_6Phrase_29__iter__, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_SuffixArray, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_Phrase, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_4cdec_2sa_3_sa_Phrase, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -67138,7 +69884,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_SuffixArray = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_SuffixArray, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_Phrase, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -67150,83 +69896,114 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_SuffixArray = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Rule(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_Rule *p; PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)o); + p->f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); + p->e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); + p->scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None); + p->word_alignments = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)o); - p->__pyx_v_word_ids = 0; - p->__pyx_v_words = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_word_ids); - Py_CLEAR(p->__pyx_v_words); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Rule(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_Rule *p = (struct __pyx_obj_4cdec_2sa_3_sa_Rule *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->f); + Py_CLEAR(p->e); + Py_CLEAR(p->scores); + Py_CLEAR(p->word_alignments); + (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_Rule(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)o; - if (p->__pyx_v_word_ids) { - e = (*v)(p->__pyx_v_word_ids, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_Rule *p = (struct __pyx_obj_4cdec_2sa_3_sa_Rule *)o; + if (p->f) { + e = (*v)(((PyObject*)p->f), a); if (e) return e; } - if (p->__pyx_v_words) { - e = (*v)(p->__pyx_v_words, a); if (e) return e; + if (p->e) { + e = (*v)(((PyObject*)p->e), a); if (e) return e; + } + if (p->scores) { + e = (*v)(((PyObject*)p->scores), 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_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_Rule(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_word_ids); - p->__pyx_v_word_ids = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_Rule *p = (struct __pyx_obj_4cdec_2sa_3_sa_Rule *)o; + tmp = ((PyObject*)p->f); + p->f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_words); - p->__pyx_v_words = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->e); + p->e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->scores); + p->scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)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 PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice[] = { +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_4Rule_f(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_4Rule_1f_1__get__(o); +} + +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_4Rule_e(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_4Rule_1e_1__get__(o); +} + +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Rule[] = { + {__Pyx_NAMESTR("fmerge"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_4Rule_7fmerge, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("arity"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_4Rule_9arity, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("alignments"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_4Rule_13alignments, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = { +static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_Rule[] = { + {(char *)"f", __pyx_getprop_4cdec_2sa_3_sa_4Rule_f, 0, 0, 0}, + {(char *)"e", __pyx_getprop_4cdec_2sa_3_sa_4Rule_e, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Rule = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_4_make_lattice"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.Rule"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Rule), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_Rule, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ + __pyx_pw_4cdec_2sa_3_sa_4Rule_5__cmp__, /*tp_compare*/ #else 0, /*reserved*/ #endif @@ -67234,23 +70011,23 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ + __pyx_pw_4cdec_2sa_3_sa_4Rule_3__hash__, /*tp_hash*/ 0, /*tp_call*/ - 0, /*tp_str*/ + __pyx_pw_4cdec_2sa_3_sa_4Rule_11__str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_Rule, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_Rule, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_Rule, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_4cdec_2sa_3_sa_Rule, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -67258,7 +70035,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_Rule, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -67270,78 +70047,56 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap __pyx_vtable_4cdec_2sa_3_sa_StringMap; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_StringMap(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_StringMap *p; PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o); - p->__pyx_v_a = 0; - p->__pyx_v_self = 0; - return o; -} - -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_a); - Py_CLEAR(p->__pyx_v_self); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o); } else { - (*Py_TYPE(o)->tp_free)(o); + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_StringMap; + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_9StringMap_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; } + return o; } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o; - if (p->__pyx_v_a) { - e = (*v)(p->__pyx_v_a, a); if (e) return e; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_StringMap(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } - if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_4cdec_2sa_3_sa_9StringMap_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); } - return 0; -} - -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o; - PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_a); - p->__pyx_v_a = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; + (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule[] = { +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_StringMap[] = { {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_StringMap = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_24_fmt_rule"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.StringMap"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_StringMap), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_StringMap, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -67360,15 +70115,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_StringMap, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -67378,7 +70133,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_StringMap, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -67390,196 +70145,214 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray __pyx_vtable_4cdec_2sa_3_sa_DataArray; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_LCP(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_LCP *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_DataArray(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_DataArray *p; PyObject *o; - o = (*t->tp_alloc)(t, 0); + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_LCP *)o); - p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); - p->lcp = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_3LCP_1__cinit__(o, a, k) < 0)) { + p = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_DataArray; + p->word2id = Py_None; Py_INCREF(Py_None); + p->id2word = Py_None; Py_INCREF(Py_None); + p->data = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->sent_id = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_9DataArray_1__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_LCP(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_LCP *p = (struct __pyx_obj_4cdec_2sa_3_sa_LCP *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_DataArray(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_DataArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->sa); - Py_CLEAR(p->lcp); + Py_CLEAR(p->word2id); + Py_CLEAR(p->id2word); + Py_CLEAR(p->data); + Py_CLEAR(p->sent_id); + Py_CLEAR(p->sent_index); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_LCP(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_DataArray(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_LCP *p = (struct __pyx_obj_4cdec_2sa_3_sa_LCP *)o; - if (p->sa) { - e = (*v)(((PyObject*)p->sa), a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_DataArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)o; + if (p->word2id) { + e = (*v)(p->word2id, a); if (e) return e; } - if (p->lcp) { - e = (*v)(((PyObject*)p->lcp), 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; + } + if (p->sent_index) { + e = (*v)(((PyObject*)p->sent_index), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa_LCP(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_LCP *p = (struct __pyx_obj_4cdec_2sa_3_sa_LCP *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_DataArray(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->sa); - p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_DataArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)o; + tmp = ((PyObject*)p->word2id); + p->word2id = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->lcp); - p->lcp = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->id2word); + p->id2word = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->data); + p->data = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->sent_id); + p->sent_id = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->sent_index); + p->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } +static PyObject *__pyx_sq_item_4cdec_2sa_3_sa_DataArray(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 PyMethodDef __pyx_methods_4cdec_2sa_3_sa_LCP[] = { - {__Pyx_NAMESTR("compute_stats"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_3LCP_3compute_stats, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_3LCP_2compute_stats)}, - {0, 0, 0, 0} -}; +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9DataArray_word2id(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_1__get__(o); +} -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_LCP = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.LCP"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_LCP), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_LCP, /*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*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_LCP, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_LCP, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_LCP, /*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_4cdec_2sa_3_sa_LCP, /*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 - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; +static int __pyx_setprop_4cdec_2sa_3_sa_9DataArray_word2id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_5__del__(o); + } +} -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = 0; +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9DataArray_id2word(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_1__get__(o); +} -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *p; - PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; +static int __pyx_setprop_4cdec_2sa_3_sa_9DataArray_id2word(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_5__del__(o); } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_a = 0; - p->__pyx_t_0 = 0; - return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_a); - Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9DataArray_data(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_1__get__(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; +static int __pyx_setprop_4cdec_2sa_3_sa_9DataArray_data(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_3__set__(o, v); } - if (p->__pyx_v_a) { - e = (*v)(p->__pyx_v_a, a); if (e) return e; + else { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_5__del__(o); } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; +} + +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9DataArray_sent_id(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_9DataArray_sent_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_5__del__(o); } - return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o; - PyObject* tmp; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_a); - p->__pyx_v_a = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9DataArray_sent_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_9DataArray_sent_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_5__del__(o); + } } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr[] = { +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_DataArray[] = { + {__Pyx_NAMESTR("get_sentence_id"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_5get_sentence_id, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_sentence"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_7get_sentence, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_id"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_9get_id, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_sentence_bounds"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_13get_sentence_bounds, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_15write_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_17read_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_bitext"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_19read_bitext, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_text_data"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_21read_text_data, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_23read_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_25write_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_enhanced_handle"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_27write_enhanced_handle, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_29write_enhanced, METH_O, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = { +static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_DataArray[] = { + {(char *)"word2id", __pyx_getprop_4cdec_2sa_3_sa_9DataArray_word2id, __pyx_setprop_4cdec_2sa_3_sa_9DataArray_word2id, 0, 0}, + {(char *)"id2word", __pyx_getprop_4cdec_2sa_3_sa_9DataArray_id2word, __pyx_setprop_4cdec_2sa_3_sa_9DataArray_id2word, 0, 0}, + {(char *)"data", __pyx_getprop_4cdec_2sa_3_sa_9DataArray_data, __pyx_setprop_4cdec_2sa_3_sa_9DataArray_data, 0, 0}, + {(char *)"sent_id", __pyx_getprop_4cdec_2sa_3_sa_9DataArray_sent_id, __pyx_setprop_4cdec_2sa_3_sa_9DataArray_sent_id, 0, 0}, + {(char *)"sent_index", __pyx_getprop_4cdec_2sa_3_sa_9DataArray_sent_index, __pyx_setprop_4cdec_2sa_3_sa_9DataArray_sent_index, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_DataArray = { + __pyx_pw_4cdec_2sa_3_sa_9DataArray_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_4cdec_2sa_3_sa_DataArray, /*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_DataArray = { + __pyx_pw_4cdec_2sa_3_sa_9DataArray_3__len__, /*mp_length*/ + __pyx_pw_4cdec_2sa_3_sa_9DataArray_11__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_DataArray = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_17_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.DataArray"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_DataArray), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_DataArray, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -67590,25 +70363,25 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = { #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ + &__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*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_DataArray, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_DataArray, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_DataArray, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_4cdec_2sa_3_sa_DataArray, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -67616,7 +70389,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_DataArray, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -67628,165 +70401,86 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment __pyx_vtable_4cdec_2sa_3_sa_Alignment; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_OnlineStats(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Alignment(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_Alignment *p; PyObject *o; - o = (*t->tp_alloc)(t, 0); + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)o); - p->samples_f = Py_None; Py_INCREF(Py_None); - p->phrases_f = Py_None; Py_INCREF(Py_None); - p->phrases_e = Py_None; Py_INCREF(Py_None); - p->phrases_fe = Py_None; Py_INCREF(Py_None); - p->phrases_al = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + p = ((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_Alignment; + p->links = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_9Alignment_5__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_OnlineStats(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *p = (struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Alignment(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_Alignment *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->samples_f); - Py_CLEAR(p->phrases_f); - Py_CLEAR(p->phrases_e); - Py_CLEAR(p->phrases_fe); - Py_CLEAR(p->phrases_al); + Py_CLEAR(p->links); + Py_CLEAR(p->sent_index); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_OnlineStats(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_Alignment(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *p = (struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)o; - if (p->samples_f) { - e = (*v)(p->samples_f, a); if (e) return e; - } - if (p->phrases_f) { - e = (*v)(p->phrases_f, a); if (e) return e; - } - if (p->phrases_e) { - e = (*v)(p->phrases_e, a); if (e) return e; - } - if (p->phrases_fe) { - e = (*v)(p->phrases_fe, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_Alignment *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)o; + if (p->links) { + e = (*v)(((PyObject*)p->links), a); if (e) return e; } - if (p->phrases_al) { - e = (*v)(p->phrases_al, 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_4cdec_2sa_3_sa_OnlineStats(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *p = (struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_Alignment(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->samples_f); - p->samples_f = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->phrases_f); - p->phrases_f = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->phrases_e); - p->phrases_e = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->phrases_fe); - p->phrases_fe = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_Alignment *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)o; + tmp = ((PyObject*)p->links); + p->links = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->phrases_al); - p->phrases_al = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->sent_index); + p->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_samples_f(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_samples_f(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_5__del__(o); - } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_f(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_f(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_5__del__(o); - } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_5__del__(o); - } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_5__del__(o); - } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_OnlineStats[] = { +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Alignment[] = { + {__Pyx_NAMESTR("unlink"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_1unlink, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_9Alignment_unlink)}, + {__Pyx_NAMESTR("get_sent_links"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_3get_sent_links, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_7read_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_9read_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_11write_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_13write_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_15write_enhanced, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("alignment"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_17alignment, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_9Alignment_16alignment)}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_OnlineStats[] = { - {(char *)"samples_f", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_samples_f, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_samples_f, 0, 0}, - {(char *)"phrases_f", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_f, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_f, 0, 0}, - {(char *)"phrases_e", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e, 0, 0}, - {(char *)"phrases_fe", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe, 0, 0}, - {(char *)"phrases_al", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_OnlineStats = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Alignment = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.OnlineStats"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.Alignment"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Alignment), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_OnlineStats, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_Alignment, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -67807,15 +70501,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_OnlineStats = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_OnlineStats, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_OnlineStats, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_Alignment, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_Alignment, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_OnlineStats, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_Alignment, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_4cdec_2sa_3_sa_OnlineStats, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -67823,7 +70517,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_OnlineStats = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_OnlineStats, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_Alignment, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -67835,95 +70529,136 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_OnlineStats = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList __pyx_vtable_4cdec_2sa_3_sa_IntList; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_BiLex __pyx_vtable_4cdec_2sa_3_sa_BiLex; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_IntList(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_IntList *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BiLex(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_BiLex *p; PyObject *o; - o = (*t->tp_alloc)(t, 0); + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_IntList; - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_7IntList_1__cinit__(o, a, k) < 0)) { + p = ((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_BiLex; + p->col1 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); + p->col2 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); + p->f_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->e_index = ((struct __pyx_obj_4cdec_2sa_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 (unlikely(__pyx_pw_4cdec_2sa_3_sa_5BiLex_1__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_IntList(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_4cdec_2sa_3_sa_7IntList_15__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_BiLex(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_BiLex *p = (struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->col1); + Py_CLEAR(p->col2); + Py_CLEAR(p->f_index); + Py_CLEAR(p->e_index); + Py_CLEAR(p->id2eword); + Py_CLEAR(p->id2fword); + Py_CLEAR(p->eword2id); + Py_CLEAR(p->fword2id); (*Py_TYPE(o)->tp_free)(o); } -static PyObject *__pyx_sq_item_4cdec_2sa_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_mp_ass_subscript_4cdec_2sa_3_sa_IntList(PyObject *o, PyObject *i, PyObject *v) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_7IntList_22__setitem__(o, i, v); +static int __pyx_tp_traverse_4cdec_2sa_3_sa_BiLex(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4cdec_2sa_3_sa_BiLex *p = (struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)o; + if (p->col1) { + e = (*v)(((PyObject*)p->col1), a); if (e) return e; } - else { - PyErr_Format(PyExc_NotImplementedError, - "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name); - return -1; + 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 PyMethodDef __pyx_methods_4cdec_2sa_3_sa_IntList[] = { - {__Pyx_NAMESTR("index"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_5index, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("partition"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_7partition, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("_doquicksort"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_9_doquicksort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("sort"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_11sort, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_13reset, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_size"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_26get_size, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_28append, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("extend"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_30extend, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_32write, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7IntList_34read, METH_O, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static PySequenceMethods __pyx_tp_as_sequence_IntList = { - __pyx_pw_4cdec_2sa_3_sa_7IntList_24__len__, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_4cdec_2sa_3_sa_IntList, /*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 int __pyx_tp_clear_4cdec_2sa_3_sa_BiLex(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa_BiLex *p = (struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)o; + tmp = ((PyObject*)p->col1); + p->col1 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->col2); + p->col2 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->f_index); + p->f_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->e_index); + p->e_index = ((struct __pyx_obj_4cdec_2sa_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 PyMappingMethods __pyx_tp_as_mapping_IntList = { - __pyx_pw_4cdec_2sa_3_sa_7IntList_24__len__, /*mp_length*/ - __pyx_pw_4cdec_2sa_3_sa_7IntList_20__getitem__, /*mp_subscript*/ - __pyx_mp_ass_subscript_4cdec_2sa_3_sa_IntList, /*mp_ass_subscript*/ +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_BiLex[] = { + {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_3write_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_5read_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("contains_e_word"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_7contains_e_word, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("contains_f_word"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_9contains_f_word, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_e_id"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_11get_e_id, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_f_id"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_13get_f_id, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_15read_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_17write_enhanced, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_score"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_19get_score, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_21write_text, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_5BiLex_20write_text)}, + {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_IntList = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BiLex = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.IntList"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_IntList), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.BiLex"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_BiLex), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_IntList, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_BiLex, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -67934,23 +70669,23 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_IntList = { #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_IntList, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_IntList, /*tp_as_mapping*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ - __pyx_pw_4cdec_2sa_3_sa_7IntList_3__str__, /*tp_str*/ + 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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_4cdec_2sa_3_sa_BiLex, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_BiLex, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pw_4cdec_2sa_3_sa_7IntList_17__iter__, /*tp_iter*/ + 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_IntList, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_BiLex, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -67960,7 +70695,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_IntList = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_IntList, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_BiLex, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -67972,106 +70707,57 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_IntList = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase __pyx_vtable_4cdec_2sa_3_sa_Phrase; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Phrase(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_Phrase *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BitSetIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_Phrase; - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_6Phrase_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } + if (unlikely(!o)) return 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Phrase(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_4cdec_2sa_3_sa_6Phrase_3__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_BitSetIterator(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } + #endif (*Py_TYPE(o)->tp_free)(o); } -static PyObject *__pyx_sq_item_4cdec_2sa_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); - Py_DECREF(x); - return r; -} -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_6Phrase_words(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_6Phrase_5words_1__get__(o); -} - -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Phrase[] = { - {__Pyx_NAMESTR("handle"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_7handle, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_6Phrase_6handle)}, - {__Pyx_NAMESTR("strhandle"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_9strhandle, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("arity"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_11arity, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getvarpos"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_13getvarpos, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getvar"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_15getvar, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("clen"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_17clen, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getchunk"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_19getchunk, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("subst"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_32subst, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_BitSetIterator[] = { + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_14BitSetIterator_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_Phrase[] = { - {(char *)"words", __pyx_getprop_4cdec_2sa_3_sa_6Phrase_words, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PySequenceMethods __pyx_tp_as_sequence_Phrase = { - __pyx_pw_4cdec_2sa_3_sa_6Phrase_25__len__, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_4cdec_2sa_3_sa_Phrase, /*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_Phrase = { - __pyx_pw_4cdec_2sa_3_sa_6Phrase_25__len__, /*mp_length*/ - __pyx_pw_4cdec_2sa_3_sa_6Phrase_27__getitem__, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Phrase = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BitSetIterator = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.Phrase"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Phrase), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.BitSetIterator"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_Phrase, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_BitSetIterator, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 - __pyx_pw_4cdec_2sa_3_sa_6Phrase_21__cmp__, /*tp_compare*/ + 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_Phrase, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Phrase, /*tp_as_mapping*/ - __pyx_pw_4cdec_2sa_3_sa_6Phrase_23__hash__, /*tp_hash*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ 0, /*tp_call*/ - __pyx_pw_4cdec_2sa_3_sa_6Phrase_5__str__, /*tp_str*/ + 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ @@ -68081,11 +70767,11 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Phrase = { 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pw_4cdec_2sa_3_sa_6Phrase_29__iter__, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_Phrase, /*tp_methods*/ + 0, /*tp_iter*/ + __pyx_pw_4cdec_2sa_3_sa_14BitSetIterator_1__next__, /*tp_iternext*/ + __pyx_methods_4cdec_2sa_3_sa_BitSetIterator, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_4cdec_2sa_3_sa_Phrase, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -68093,7 +70779,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Phrase = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_Phrase, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_BitSetIterator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -68105,77 +70791,75 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Phrase = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_TrieNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BitSet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)o); - p->children = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_6BitSet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieNode(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->children); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_4cdec_2sa_3_sa_TrieNode(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)o; - if (p->children) { - e = (*v)(p->children, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_4cdec_2sa_3_sa_TrieNode(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)o; - PyObject* tmp; - tmp = ((PyObject*)p->children); - p->children = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_8TrieNode_children(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_8TrieNode_children(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_3__set__(o, v); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_BitSet(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } - else { - return __pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_5__del__(o); + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_4cdec_2sa_3_sa_6BitSet_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); } + (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_TrieNode[] = { +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_BitSet[] = { + {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6BitSet_7insert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("findsucc"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6BitSet_9findsucc, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("min"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6BitSet_13min, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("max"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6BitSet_15max, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_TrieNode[] = { - {(char *)"children", __pyx_getprop_4cdec_2sa_3_sa_8TrieNode_children, __pyx_setprop_4cdec_2sa_3_sa_8TrieNode_children, 0, 0}, - {0, 0, 0, 0, 0} +static PySequenceMethods __pyx_tp_as_sequence_BitSet = { + __pyx_pw_4cdec_2sa_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_4cdec_2sa_3_sa_6BitSet_19__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieNode = { +static PyMappingMethods __pyx_tp_as_mapping_BitSet = { + __pyx_pw_4cdec_2sa_3_sa_6BitSet_17__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BitSet = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.TrieNode"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_TrieNode), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.BitSet"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_BitSet), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieNode, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_BitSet, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -68186,25 +70870,25 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieNode = { #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ + &__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_4cdec_2sa_3_sa_6BitSet_11__str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_TrieNode, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_TrieNode, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ + __pyx_pw_4cdec_2sa_3_sa_6BitSet_5__iter__, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_TrieNode, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_BitSet, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_4cdec_2sa_3_sa_TrieNode, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -68212,7 +70896,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieNode = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_TrieNode, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_BitSet, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -68224,86 +70908,42 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieNode = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_VEBIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_line = 0; - p->__pyx_t_0 = 0; - return o; -} - -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_line); - Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *)o); } else { - (*Py_TYPE(o)->tp_free)(o); + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } + if (unlikely(!o)) return 0; + return o; } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_line) { - e = (*v)(p->__pyx_v_line, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_VEBIterator(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } - return 0; -} - -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *)o; - PyObject* tmp; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_line); - p->__pyx_v_line = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; + #endif + (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr[] = { +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_VEBIterator[] = { + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11VEBIterator_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_VEBIterator = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_2_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.VEBIterator"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_VEBIterator), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_VEBIterator, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -68322,15 +70962,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr, /*tp_methods*/ + __pyx_pw_4cdec_2sa_3_sa_11VEBIterator_1__next__, /*tp_iternext*/ + __pyx_methods_4cdec_2sa_3_sa_VEBIterator, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -68340,7 +70980,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_VEBIterator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -68352,70 +70992,77 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB __pyx_vtable_4cdec_2sa_3_sa_VEB; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_VEB(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_VEB *p; PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_VEB; + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_3VEB_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)o); - p->__pyx_v_fp = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_fp); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_VEB(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } -} - -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)o; - if (p->__pyx_v_fp) { - e = (*v)(p->__pyx_v_fp, a); if (e) return e; + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_4cdec_2sa_3_sa_3VEB_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); } - return 0; -} - -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)o; - PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_fp); - p->__pyx_v_fp = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; + (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext[] = { +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_VEB[] = { + {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_3VEB_7insert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("findsucc"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_3VEB_9findsucc, METH_O, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = { +static PySequenceMethods __pyx_tp_as_sequence_VEB = { + __pyx_pw_4cdec_2sa_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*/ + __pyx_pw_4cdec_2sa_3_sa_3VEB_13__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_VEB = { + __pyx_pw_4cdec_2sa_3_sa_3VEB_11__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_VEB = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_1_read_bitext"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.VEB"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_VEB), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_VEB, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -68426,23 +71073,23 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ + &__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*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ + __pyx_pw_4cdec_2sa_3_sa_3VEB_5__iter__, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_VEB, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -68452,7 +71099,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_VEB, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -68464,86 +71111,77 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_LCP(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_LCP *p; PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_LCP *)o); + p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); + p->lcp = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_3LCP_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_feat = 0; - p->__pyx_t_0 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_feat); - Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_LCP(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_LCP *p = (struct __pyx_obj_4cdec_2sa_3_sa_LCP *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->sa); + Py_CLEAR(p->lcp); + (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_LCP(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_feat) { - e = (*v)(p->__pyx_v_feat, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_LCP *p = (struct __pyx_obj_4cdec_2sa_3_sa_LCP *)o; + if (p->sa) { + e = (*v)(((PyObject*)p->sa), a); if (e) return e; } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, 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_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_LCP(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_feat); - p->__pyx_v_feat = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_LCP *p = (struct __pyx_obj_4cdec_2sa_3_sa_LCP *)o; + tmp = ((PyObject*)p->sa); + p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->lcp); + p->lcp = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr[] = { +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_LCP[] = { + {__Pyx_NAMESTR("compute_stats"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_3LCP_3compute_stats, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_3LCP_2compute_stats)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_LCP = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_29_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.LCP"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_LCP), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_LCP, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -68562,15 +71200,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_LCP, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_LCP, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_LCP, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -68580,7 +71218,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_LCP, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -68592,102 +71230,108 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet __pyx_vtable_4cdec_2sa_3_sa_Alphabet; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Alphabet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *p; PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_Alphabet; + p->terminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); + p->nonterminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); + p->id2sym = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_8Alphabet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o); - p->__pyx_v_extract = 0; - p->__pyx_v_f_len = 0; - p->__pyx_v_f_words = 0; - p->__pyx_v_phrases = 0; - p->__pyx_v_self = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Alphabet(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_extract); - Py_CLEAR(p->__pyx_v_f_len); - Py_CLEAR(p->__pyx_v_f_words); - Py_CLEAR(p->__pyx_v_phrases); - Py_CLEAR(p->__pyx_v_self); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_4cdec_2sa_3_sa_8Alphabet_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); } + Py_CLEAR(p->terminals); + Py_CLEAR(p->nonterminals); + Py_CLEAR(p->id2sym); + (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_Alphabet(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o; - if (p->__pyx_v_extract) { - e = (*v)(p->__pyx_v_extract, a); if (e) return e; - } - if (p->__pyx_v_f_len) { - e = (*v)(p->__pyx_v_f_len, a); if (e) return e; - } - if (p->__pyx_v_f_words) { - e = (*v)(p->__pyx_v_f_words, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)o; + if (p->terminals) { + e = (*v)(((PyObject*)p->terminals), a); if (e) return e; } - if (p->__pyx_v_phrases) { - e = (*v)(p->__pyx_v_phrases, a); if (e) return e; + if (p->nonterminals) { + e = (*v)(((PyObject*)p->nonterminals), a); if (e) return e; } - if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + if (p->id2sym) { + e = (*v)(p->id2sym, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_Alphabet(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_extract); - p->__pyx_v_extract = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_f_len); - p->__pyx_v_f_len = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_f_words); - p->__pyx_v_f_words = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)o; + tmp = ((PyObject*)p->terminals); + p->terminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_phrases); - p->__pyx_v_phrases = ((PyObject*)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->nonterminals); + p->nonterminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)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 PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases[] = { +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_8Alphabet_terminals(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_8Alphabet_9terminals_1__get__(o); +} + +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_8Alphabet_nonterminals(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_8Alphabet_12nonterminals_1__get__(o); +} + +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Alphabet[] = { {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = { +static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_Alphabet[] = { + {(char *)"terminals", __pyx_getprop_4cdec_2sa_3_sa_8Alphabet_terminals, 0, 0, 0}, + {(char *)"nonterminals", __pyx_getprop_4cdec_2sa_3_sa_8Alphabet_nonterminals, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Alphabet = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_26_get_f_phrases"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.Alphabet"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Alphabet), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_Alphabet, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -68706,17 +71350,17 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrase 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_Alphabet, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_Alphabet, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_Alphabet, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_4cdec_2sa_3_sa_Alphabet, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -68724,7 +71368,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrase 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_Alphabet, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -68736,123 +71380,182 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrase #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap __pyx_vtable_4cdec_2sa_3_sa_TrieMap; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_ExtendedTrieNode(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *p; - PyObject *o = __pyx_tp_new_4cdec_2sa_3_sa_TrieNode(t, a, k); +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_TrieMap(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_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 (unlikely(__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(o, a, k) < 0)) { + p = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_TrieMap; + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_7TrieMap_1__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_ExtendedTrieNode(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->phrase); - Py_CLEAR(p->phrase_location); - Py_CLEAR(p->suffix_link); - PyObject_GC_Track(o); - __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieNode(o); -} - -static int __pyx_tp_traverse_4cdec_2sa_3_sa_ExtendedTrieNode(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)o; - e = __pyx_tp_traverse_4cdec_2sa_3_sa_TrieNode(o, v, a); if (e) return e; - if (p->phrase) { - e = (*v)(p->phrase, a); if (e) return e; - } - if (p->phrase_location) { - e = (*v)(p->phrase_location, a); if (e) return e; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieMap(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } - if (p->suffix_link) { - e = (*v)(p->suffix_link, a); if (e) return e; + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_4cdec_2sa_3_sa_7TrieMap_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); } - return 0; + (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_clear_4cdec_2sa_3_sa_ExtendedTrieNode(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)o; - PyObject* tmp; - __pyx_tp_clear_4cdec_2sa_3_sa_TrieNode(o); - tmp = ((PyObject*)p->phrase); - p->phrase = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->phrase_location); - p->phrase_location = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->suffix_link); - p->suffix_link = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_TrieMap[] = { + {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7TrieMap_5insert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("contains"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7TrieMap_7contains, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("toMap"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7TrieMap_9toMap, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_1__get__(o); -} +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieMap = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cdec.sa._sa.TrieMap"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieMap, /*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*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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*/ + 0, /*tp_iternext*/ + __pyx_methods_4cdec_2sa_3_sa_TrieMap, /*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_4cdec_2sa_3_sa_TrieMap, /*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 + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Precomputation __pyx_vtable_4cdec_2sa_3_sa_Precomputation; -static int __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_3__set__(o, v); +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Precomputation(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } - else { - return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_5__del__(o); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_Precomputation; + p->precomputed_index = Py_None; Py_INCREF(Py_None); + p->precomputed_collocations = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_14Precomputation_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; } + return o; } -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Precomputation(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *p = (struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->precomputed_index); + Py_CLEAR(p->precomputed_collocations); + (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_3__set__(o, v); +static int __pyx_tp_traverse_4cdec_2sa_3_sa_Precomputation(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *p = (struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)o; + if (p->precomputed_index) { + e = (*v)(p->precomputed_index, a); if (e) return e; } - else { - return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_5__del__(o); + if (p->precomputed_collocations) { + e = (*v)(p->precomputed_collocations, a); if (e) return e; } + return 0; } -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_5__del__(o); - } +static int __pyx_tp_clear_4cdec_2sa_3_sa_Precomputation(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *p = (struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)o; + tmp = ((PyObject*)p->precomputed_index); + p->precomputed_index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->precomputed_collocations); + p->precomputed_collocations = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_ExtendedTrieNode[] = { +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Precomputation[] = { + {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_14Precomputation_3read_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_14Precomputation_5write_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("precompute"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_14Precomputation_7precompute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_ExtendedTrieNode[] = { - {(char *)"phrase", __pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase, __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase, 0, 0}, - {(char *)"phrase_location", __pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase_location, __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase_location, 0, 0}, - {(char *)"suffix_link", __pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_suffix_link, __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_suffix_link, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Precomputation = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.ExtendedTrieNode"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.Precomputation"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_Precomputation, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -68873,15 +71576,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_Precomputation, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_Precomputation, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_Precomputation, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -68889,7 +71592,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_Precomputation, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -68901,77 +71604,119 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment __pyx_vtable_4cdec_2sa_3_sa_Alignment; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_SuffixArray __pyx_vtable_4cdec_2sa_3_sa_SuffixArray; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Alignment(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_Alignment *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_SuffixArray(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *p; PyObject *o; - o = (*t->tp_alloc)(t, 0); + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_Alignment; - p->links = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_9Alignment_5__cinit__(o, a, k) < 0)) { + p = ((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_SuffixArray; + p->darray = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); + p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->ha = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_1__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Alignment(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Alignment *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_SuffixArray(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->links); - Py_CLEAR(p->sent_index); + Py_CLEAR(p->darray); + Py_CLEAR(p->sa); + Py_CLEAR(p->ha); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_Alignment(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_SuffixArray(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_Alignment *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)o; - if (p->links) { - e = (*v)(((PyObject*)p->links), a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)o; + if (p->darray) { + e = (*v)(((PyObject*)p->darray), a); if (e) return e; } - if (p->sent_index) { - e = (*v)(((PyObject*)p->sent_index), a); if (e) return e; + if (p->sa) { + e = (*v)(((PyObject*)p->sa), a); if (e) return e; + } + if (p->ha) { + e = (*v)(((PyObject*)p->ha), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa_Alignment(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Alignment *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_SuffixArray(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->links); - p->links = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)o; + tmp = ((PyObject*)p->darray); + p->darray = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->sent_index); - p->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->sa); + p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->ha); + p->ha = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } +static PyObject *__pyx_sq_item_4cdec_2sa_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); + Py_DECREF(x); + return r; +} -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Alignment[] = { - {__Pyx_NAMESTR("unlink"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_1unlink, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_9Alignment_unlink)}, - {__Pyx_NAMESTR("get_sent_links"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_3get_sent_links, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_7read_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_9read_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_11write_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_13write_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_15write_enhanced, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("alignment"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9Alignment_17alignment, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_9Alignment_16alignment)}, +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_SuffixArray[] = { + {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_5read_text, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_11SuffixArray_4read_text)}, + {__Pyx_NAMESTR("q3sort"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_7q3sort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_11SuffixArray_6q3sort)}, + {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_9write_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_11read_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_13write_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_15write_enhanced, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11SuffixArray_17lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Alignment = { +static PySequenceMethods __pyx_tp_as_sequence_SuffixArray = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_4cdec_2sa_3_sa_SuffixArray, /*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_SuffixArray = { + 0, /*mp_length*/ + __pyx_pw_4cdec_2sa_3_sa_11SuffixArray_3__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_SuffixArray = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.Alignment"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Alignment), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.SuffixArray"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_Alignment, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_SuffixArray, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -68982,8 +71727,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Alignment = { #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ + &__pyx_tp_as_sequence_SuffixArray, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_SuffixArray, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ @@ -68992,13 +71737,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Alignment = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_Alignment, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_Alignment, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_SuffixArray, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_SuffixArray, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_Alignment, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_SuffixArray, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -69008,7 +71753,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Alignment = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_Alignment, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_SuffixArray, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -69020,534 +71765,174 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Alignment = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_input[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_OnlineStats(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *p; PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_input[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)o); + p->samples_f = Py_None; Py_INCREF(Py_None); + p->phrases_f = Py_None; Py_INCREF(Py_None); + p->phrases_e = Py_None; Py_INCREF(Py_None); + p->phrases_fe = Py_None; Py_INCREF(Py_None); + p->phrases_al = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o); - p->__pyx_v_alignment = 0; - p->__pyx_v_als = 0; - p->__pyx_v_alslist = 0; - p->__pyx_v_chunklen = 0; - p->__pyx_v_count = 0; - p->__pyx_v_ctx_name = 0; - p->__pyx_v_e = 0; - p->__pyx_v_elist = 0; - p->__pyx_v_extract = 0; - p->__pyx_v_extract_start = 0; - p->__pyx_v_extract_stop = 0; - p->__pyx_v_extracts = 0; - p->__pyx_v_f = 0; - p->__pyx_v_f_syms = 0; - p->__pyx_v_fcount = 0; - p->__pyx_v_fphrases = 0; - p->__pyx_v_frontier = 0; - p->__pyx_v_frontier_nodes = 0; - p->__pyx_v_fwords = 0; - p->__pyx_v_genexpr = 0; - p->__pyx_v_hiero_phrase = 0; - p->__pyx_v_input_match = 0; - p->__pyx_v_intersect_start_time = 0; - p->__pyx_v_intersect_stop_time = 0; - p->__pyx_v_is_shadow_path = 0; - p->__pyx_v_key = 0; - p->__pyx_v_lex_i = 0; - p->__pyx_v_lex_j = 0; - p->__pyx_v_loc = 0; - p->__pyx_v_locs = 0; - p->__pyx_v_max_locs = 0; - p->__pyx_v_meta = 0; - p->__pyx_v_new_frontier = 0; - p->__pyx_v_new_node = 0; - p->__pyx_v_next_states = 0; - p->__pyx_v_node = 0; - p->__pyx_v_nodes_isteps_away_buffer = 0; - p->__pyx_v_pathlen = 0; - p->__pyx_v_phrase = 0; - p->__pyx_v_phrase_location = 0; - p->__pyx_v_prefix = 0; - p->__pyx_v_reachable_buffer = 0; - p->__pyx_v_sa_range = 0; - p->__pyx_v_sample = 0; - p->__pyx_v_scores = 0; - p->__pyx_v_seen_phrases = 0; - p->__pyx_v_self = 0; - p->__pyx_v_spanlen = 0; - p->__pyx_v_stats = 0; - p->__pyx_v_stop_time = 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_3 = 0; - p->__pyx_t_4 = 0; - p->__pyx_t_5 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_alignment); - Py_CLEAR(p->__pyx_v_als); - Py_CLEAR(p->__pyx_v_alslist); - Py_CLEAR(p->__pyx_v_chunklen); - Py_CLEAR(p->__pyx_v_count); - Py_CLEAR(p->__pyx_v_ctx_name); - Py_CLEAR(p->__pyx_v_e); - Py_CLEAR(p->__pyx_v_elist); - Py_CLEAR(p->__pyx_v_extract); - Py_CLEAR(p->__pyx_v_extract_start); - Py_CLEAR(p->__pyx_v_extract_stop); - Py_CLEAR(p->__pyx_v_extracts); - Py_CLEAR(p->__pyx_v_f); - Py_CLEAR(p->__pyx_v_f_syms); - Py_CLEAR(p->__pyx_v_fcount); - Py_CLEAR(p->__pyx_v_fphrases); - Py_CLEAR(p->__pyx_v_frontier); - Py_CLEAR(p->__pyx_v_frontier_nodes); - Py_CLEAR(p->__pyx_v_fwords); - Py_CLEAR(p->__pyx_v_genexpr); - Py_CLEAR(p->__pyx_v_hiero_phrase); - Py_CLEAR(p->__pyx_v_input_match); - Py_CLEAR(p->__pyx_v_intersect_start_time); - Py_CLEAR(p->__pyx_v_intersect_stop_time); - Py_CLEAR(p->__pyx_v_is_shadow_path); - Py_CLEAR(p->__pyx_v_key); - Py_CLEAR(p->__pyx_v_lex_i); - Py_CLEAR(p->__pyx_v_lex_j); - Py_CLEAR(p->__pyx_v_loc); - Py_CLEAR(p->__pyx_v_locs); - Py_CLEAR(p->__pyx_v_max_locs); - Py_CLEAR(p->__pyx_v_meta); - Py_CLEAR(p->__pyx_v_new_frontier); - Py_CLEAR(p->__pyx_v_new_node); - Py_CLEAR(p->__pyx_v_next_states); - Py_CLEAR(p->__pyx_v_node); - Py_CLEAR(p->__pyx_v_nodes_isteps_away_buffer); - Py_CLEAR(p->__pyx_v_pathlen); - Py_CLEAR(p->__pyx_v_phrase); - Py_CLEAR(p->__pyx_v_phrase_location); - Py_CLEAR(p->__pyx_v_prefix); - Py_CLEAR(p->__pyx_v_reachable_buffer); - Py_CLEAR(p->__pyx_v_sa_range); - Py_CLEAR(p->__pyx_v_sample); - Py_CLEAR(p->__pyx_v_scores); - Py_CLEAR(p->__pyx_v_seen_phrases); - Py_CLEAR(p->__pyx_v_self); - Py_CLEAR(p->__pyx_v_spanlen); - Py_CLEAR(p->__pyx_v_stats); - Py_CLEAR(p->__pyx_v_stop_time); - Py_CLEAR(p->__pyx_v_suffix_link); - Py_CLEAR(p->__pyx_v_suffix_link_xcat_index); - Py_CLEAR(p->__pyx_v_word_id); - Py_CLEAR(p->__pyx_v_xcat_index); - Py_CLEAR(p->__pyx_v_xnode); - Py_CLEAR(p->__pyx_v_xroot); - Py_CLEAR(p->__pyx_t_3); - Py_CLEAR(p->__pyx_t_4); - Py_CLEAR(p->__pyx_t_5); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_input[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_OnlineStats(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *p = (struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->samples_f); + Py_CLEAR(p->phrases_f); + Py_CLEAR(p->phrases_e); + Py_CLEAR(p->phrases_fe); + Py_CLEAR(p->phrases_al); + (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_OnlineStats(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o; - if (p->__pyx_v_alignment) { - e = (*v)(p->__pyx_v_alignment, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *p = (struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)o; + if (p->samples_f) { + e = (*v)(p->samples_f, a); if (e) return e; } - if (p->__pyx_v_als) { - e = (*v)(p->__pyx_v_als, a); if (e) return e; + if (p->phrases_f) { + e = (*v)(p->phrases_f, a); if (e) return e; } - if (p->__pyx_v_alslist) { - e = (*v)(p->__pyx_v_alslist, a); if (e) return e; - } - if (p->__pyx_v_chunklen) { - e = (*v)(((PyObject*)p->__pyx_v_chunklen), a); if (e) return e; - } - if (p->__pyx_v_count) { - e = (*v)(p->__pyx_v_count, a); if (e) return e; - } - if (p->__pyx_v_ctx_name) { - e = (*v)(p->__pyx_v_ctx_name, a); if (e) return e; - } - if (p->__pyx_v_e) { - e = (*v)(p->__pyx_v_e, a); if (e) return e; - } - if (p->__pyx_v_elist) { - e = (*v)(p->__pyx_v_elist, a); if (e) return e; - } - if (p->__pyx_v_extract) { - e = (*v)(p->__pyx_v_extract, a); if (e) return e; - } - if (p->__pyx_v_extract_start) { - e = (*v)(p->__pyx_v_extract_start, a); if (e) return e; - } - if (p->__pyx_v_extract_stop) { - e = (*v)(p->__pyx_v_extract_stop, a); if (e) return e; - } - if (p->__pyx_v_extracts) { - e = (*v)(p->__pyx_v_extracts, a); if (e) return e; - } - if (p->__pyx_v_f) { - e = (*v)(p->__pyx_v_f, a); if (e) return e; - } - if (p->__pyx_v_f_syms) { - e = (*v)(p->__pyx_v_f_syms, a); if (e) return e; - } - if (p->__pyx_v_fcount) { - e = (*v)(p->__pyx_v_fcount, a); if (e) return e; - } - if (p->__pyx_v_fphrases) { - e = (*v)(p->__pyx_v_fphrases, a); if (e) return e; - } - if (p->__pyx_v_frontier) { - e = (*v)(p->__pyx_v_frontier, a); if (e) return e; - } - if (p->__pyx_v_frontier_nodes) { - e = (*v)(p->__pyx_v_frontier_nodes, a); if (e) return e; - } - if (p->__pyx_v_fwords) { - e = (*v)(p->__pyx_v_fwords, a); if (e) return e; - } - if (p->__pyx_v_genexpr) { - e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; - } - if (p->__pyx_v_hiero_phrase) { - e = (*v)(((PyObject*)p->__pyx_v_hiero_phrase), a); if (e) return e; - } - if (p->__pyx_v_input_match) { - e = (*v)(p->__pyx_v_input_match, a); if (e) return e; - } - if (p->__pyx_v_intersect_start_time) { - e = (*v)(p->__pyx_v_intersect_start_time, a); if (e) return e; - } - if (p->__pyx_v_intersect_stop_time) { - e = (*v)(p->__pyx_v_intersect_stop_time, a); if (e) return e; - } - if (p->__pyx_v_is_shadow_path) { - e = (*v)(p->__pyx_v_is_shadow_path, a); if (e) return e; - } - if (p->__pyx_v_key) { - e = (*v)(p->__pyx_v_key, a); if (e) return e; - } - if (p->__pyx_v_lex_i) { - e = (*v)(p->__pyx_v_lex_i, a); if (e) return e; - } - if (p->__pyx_v_lex_j) { - e = (*v)(p->__pyx_v_lex_j, a); if (e) return e; - } - if (p->__pyx_v_loc) { - e = (*v)(p->__pyx_v_loc, a); if (e) return e; - } - if (p->__pyx_v_locs) { - e = (*v)(p->__pyx_v_locs, a); if (e) return e; - } - if (p->__pyx_v_max_locs) { - e = (*v)(p->__pyx_v_max_locs, a); if (e) return e; - } - if (p->__pyx_v_meta) { - e = (*v)(p->__pyx_v_meta, a); if (e) return e; - } - if (p->__pyx_v_new_frontier) { - e = (*v)(p->__pyx_v_new_frontier, a); if (e) return e; - } - if (p->__pyx_v_new_node) { - e = (*v)(p->__pyx_v_new_node, a); if (e) return e; - } - if (p->__pyx_v_next_states) { - e = (*v)(p->__pyx_v_next_states, a); if (e) return e; - } - if (p->__pyx_v_node) { - e = (*v)(p->__pyx_v_node, a); if (e) return e; - } - if (p->__pyx_v_nodes_isteps_away_buffer) { - e = (*v)(p->__pyx_v_nodes_isteps_away_buffer, a); if (e) return e; - } - if (p->__pyx_v_pathlen) { - e = (*v)(p->__pyx_v_pathlen, a); if (e) return e; - } - if (p->__pyx_v_phrase) { - e = (*v)(p->__pyx_v_phrase, a); if (e) return e; - } - if (p->__pyx_v_phrase_location) { - e = (*v)(((PyObject*)p->__pyx_v_phrase_location), a); if (e) return e; - } - if (p->__pyx_v_prefix) { - e = (*v)(p->__pyx_v_prefix, a); if (e) return e; - } - if (p->__pyx_v_reachable_buffer) { - e = (*v)(p->__pyx_v_reachable_buffer, a); if (e) return e; - } - if (p->__pyx_v_sa_range) { - e = (*v)(p->__pyx_v_sa_range, a); if (e) return e; - } - if (p->__pyx_v_sample) { - e = (*v)(((PyObject*)p->__pyx_v_sample), a); if (e) return e; - } - if (p->__pyx_v_scores) { - e = (*v)(((PyObject*)p->__pyx_v_scores), a); if (e) return e; - } - if (p->__pyx_v_seen_phrases) { - e = (*v)(p->__pyx_v_seen_phrases, a); if (e) return e; - } - if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; - } - if (p->__pyx_v_spanlen) { - e = (*v)(p->__pyx_v_spanlen, a); if (e) return e; - } - if (p->__pyx_v_stats) { - e = (*v)(p->__pyx_v_stats, a); if (e) return e; - } - if (p->__pyx_v_stop_time) { - e = (*v)(p->__pyx_v_stop_time, a); if (e) return e; - } - if (p->__pyx_v_suffix_link) { - e = (*v)(p->__pyx_v_suffix_link, a); if (e) return e; - } - if (p->__pyx_v_suffix_link_xcat_index) { - e = (*v)(p->__pyx_v_suffix_link_xcat_index, a); if (e) return e; - } - if (p->__pyx_v_word_id) { - e = (*v)(p->__pyx_v_word_id, a); if (e) return e; - } - if (p->__pyx_v_xcat_index) { - e = (*v)(p->__pyx_v_xcat_index, a); if (e) return e; - } - if (p->__pyx_v_xnode) { - e = (*v)(p->__pyx_v_xnode, a); if (e) return e; - } - if (p->__pyx_v_xroot) { - e = (*v)(p->__pyx_v_xroot, a); if (e) return e; - } - if (p->__pyx_t_3) { - e = (*v)(p->__pyx_t_3, a); if (e) return e; + if (p->phrases_e) { + e = (*v)(p->phrases_e, a); if (e) return e; } - if (p->__pyx_t_4) { - e = (*v)(p->__pyx_t_4, a); if (e) return e; + if (p->phrases_fe) { + e = (*v)(p->phrases_fe, a); if (e) return e; } - if (p->__pyx_t_5) { - e = (*v)(p->__pyx_t_5, a); if (e) return e; + if (p->phrases_al) { + e = (*v)(p->phrases_al, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_OnlineStats(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_alignment); - p->__pyx_v_alignment = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_als); - p->__pyx_v_als = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_alslist); - 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_4cdec_2sa_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); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_ctx_name); - p->__pyx_v_ctx_name = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_e); - p->__pyx_v_e = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_elist); - p->__pyx_v_elist = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_extract); - p->__pyx_v_extract = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_extract_start); - p->__pyx_v_extract_start = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_extract_stop); - p->__pyx_v_extract_stop = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_extracts); - p->__pyx_v_extracts = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_f); - p->__pyx_v_f = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_f_syms); - p->__pyx_v_f_syms = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_fcount); - p->__pyx_v_fcount = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_fphrases); - p->__pyx_v_fphrases = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_frontier); - p->__pyx_v_frontier = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_frontier_nodes); - p->__pyx_v_frontier_nodes = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_fwords); - p->__pyx_v_fwords = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_genexpr); - p->__pyx_v_genexpr = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_hiero_phrase); - p->__pyx_v_hiero_phrase = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_input_match); - p->__pyx_v_input_match = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_intersect_start_time); - p->__pyx_v_intersect_start_time = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_intersect_stop_time); - p->__pyx_v_intersect_stop_time = 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); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_key); - p->__pyx_v_key = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_lex_i); - p->__pyx_v_lex_i = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_lex_j); - p->__pyx_v_lex_j = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_loc); - p->__pyx_v_loc = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_locs); - p->__pyx_v_locs = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_max_locs); - p->__pyx_v_max_locs = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_meta); - p->__pyx_v_meta = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_new_frontier); - p->__pyx_v_new_frontier = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_new_node); - p->__pyx_v_new_node = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_next_states); - p->__pyx_v_next_states = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_node); - p->__pyx_v_node = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_nodes_isteps_away_buffer); - p->__pyx_v_nodes_isteps_away_buffer = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_pathlen); - p->__pyx_v_pathlen = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_phrase); - 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_4cdec_2sa_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); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_reachable_buffer); - p->__pyx_v_reachable_buffer = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_sa_range); - 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_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_scores); - p->__pyx_v_scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_seen_phrases); - p->__pyx_v_seen_phrases = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_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); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_stats); - p->__pyx_v_stats = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - 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_suffix_link); - p->__pyx_v_suffix_link = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_suffix_link_xcat_index); - p->__pyx_v_suffix_link_xcat_index = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_word_id); - p->__pyx_v_word_id = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_xcat_index); - p->__pyx_v_xcat_index = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_xnode); - p->__pyx_v_xnode = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *p = (struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)o; + tmp = ((PyObject*)p->samples_f); + p->samples_f = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_xroot); - p->__pyx_v_xroot = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->phrases_f); + p->phrases_f = 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->phrases_e); + p->phrases_e = 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); + tmp = ((PyObject*)p->phrases_fe); + p->phrases_fe = 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); + tmp = ((PyObject*)p->phrases_al); + p->phrases_al = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_19_input[] = { +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_samples_f(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_samples_f(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_5__del__(o); + } +} + +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_f(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_f(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_5__del__(o); + } +} + +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_5__del__(o); + } +} + +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_5__del__(o); + } +} + +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_OnlineStats[] = { {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input = { +static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_OnlineStats[] = { + {(char *)"samples_f", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_samples_f, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_samples_f, 0, 0}, + {(char *)"phrases_f", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_f, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_f, 0, 0}, + {(char *)"phrases_e", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e, 0, 0}, + {(char *)"phrases_fe", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe, 0, 0}, + {(char *)"phrases_al", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_OnlineStats = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_19_input"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.OnlineStats"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_OnlineStats, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -69566,17 +71951,17 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_OnlineStats, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_OnlineStats, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_OnlineStats, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_4cdec_2sa_3_sa_OnlineStats, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -69584,7 +71969,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_OnlineStats, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -69596,70 +71981,86 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_TrieNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *p; PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)o); + p->children = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)o); - p->__pyx_v_syms = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_syms); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieNode(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->children); + (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_TrieNode(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)o; - if (p->__pyx_v_syms) { - e = (*v)(p->__pyx_v_syms, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)o; + if (p->children) { + e = (*v)(p->children, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_TrieNode(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_syms); - p->__pyx_v_syms = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *)o; + tmp = ((PyObject*)p->children); + p->children = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words[] = { - {0, 0, 0, 0} -}; +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_8TrieNode_children(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_1__get__(o); +} -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_13_decode_words"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words, /*tp_dealloc*/ +static int __pyx_setprop_4cdec_2sa_3_sa_8TrieNode_children(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_TrieNode[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_TrieNode[] = { + {(char *)"children", __pyx_getprop_4cdec_2sa_3_sa_8TrieNode_children, __pyx_setprop_4cdec_2sa_3_sa_8TrieNode_children, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieNode = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cdec.sa._sa.TrieNode"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_TrieNode), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieNode, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -69678,17 +72079,17 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_TrieNode, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_TrieNode, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_TrieNode, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_4cdec_2sa_3_sa_TrieNode, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -69696,7 +72097,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_TrieNode, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -69708,94 +72109,128 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *p; - PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_ExtendedTrieNode(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *p; + PyObject *o = __pyx_tp_new_4cdec_2sa_3_sa_TrieNode(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_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 (unlikely(__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_i = 0; - p->__pyx_v_j = 0; - p->__pyx_t_0 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_i); - Py_CLEAR(p->__pyx_v_j); - Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_ExtendedTrieNode(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->phrase); + Py_CLEAR(p->phrase_location); + Py_CLEAR(p->suffix_link); + PyObject_GC_Track(o); + __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieNode(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_ExtendedTrieNode(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_i) { - e = (*v)(p->__pyx_v_i, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)o; + e = __pyx_tp_traverse_4cdec_2sa_3_sa_TrieNode(o, v, a); if (e) return e; + if (p->phrase) { + e = (*v)(p->phrase, a); if (e) return e; } - if (p->__pyx_v_j) { - e = (*v)(p->__pyx_v_j, a); if (e) return e; + if (p->phrase_location) { + e = (*v)(p->phrase_location, a); if (e) return e; } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; + if (p->suffix_link) { + e = (*v)(p->suffix_link, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_ExtendedTrieNode(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_i); - p->__pyx_v_i = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode *)o; + __pyx_tp_clear_4cdec_2sa_3_sa_TrieNode(o); + tmp = ((PyObject*)p->phrase); + p->phrase = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_j); - p->__pyx_v_j = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->phrase_location); + p->phrase_location = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->suffix_link); + p->suffix_link = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr[] = { +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_5__del__(o); + } +} + +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_5__del__(o); + } +} + +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_ExtendedTrieNode[] = { {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = { +static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_ExtendedTrieNode[] = { + {(char *)"phrase", __pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase, __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase, 0, 0}, + {(char *)"phrase_location", __pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase_location, __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_phrase_location, 0, 0}, + {(char *)"suffix_link", __pyx_getprop_4cdec_2sa_3_sa_16ExtendedTrieNode_suffix_link, __pyx_setprop_4cdec_2sa_3_sa_16ExtendedTrieNode_suffix_link, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_23_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.ExtendedTrieNode"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -69814,17 +72249,17 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -69832,7 +72267,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_ExtendedTrieNode, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -69844,105 +72279,121 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Rule(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_Rule *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_TrieTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *p; PyObject *o; - o = (*t->tp_alloc)(t, 0); + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)o); - p->f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); - p->e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); - p->scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None); - p->word_alignments = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(o, a, k) < 0)) { + p = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)o); + p->root = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Rule(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Rule *p = (struct __pyx_obj_4cdec_2sa_3_sa_Rule *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieTable(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->f); - Py_CLEAR(p->e); - Py_CLEAR(p->scores); - Py_CLEAR(p->word_alignments); + Py_CLEAR(p->root); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_Rule(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_TrieTable(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_Rule *p = (struct __pyx_obj_4cdec_2sa_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->scores) { - e = (*v)(((PyObject*)p->scores), a); if (e) return e; - } - if (p->word_alignments) { - e = (*v)(p->word_alignments, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)o; + if (p->root) { + e = (*v)(p->root, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa_Rule(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Rule *p = (struct __pyx_obj_4cdec_2sa_3_sa_Rule *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_TrieTable(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->f); - p->f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->e); - p->e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->scores); - p->scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->word_alignments); - p->word_alignments = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)o; + tmp = ((PyObject*)p->root); + p->root = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_4Rule_f(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_4Rule_1f_1__get__(o); +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9TrieTable_extended(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_8extended_1__get__(o); } -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_4Rule_e(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_4Rule_1e_1__get__(o); +static int __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_extended(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_8extended_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Rule[] = { - {__Pyx_NAMESTR("fmerge"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_4Rule_7fmerge, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("arity"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_4Rule_9arity, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("alignments"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_4Rule_13alignments, METH_NOARGS, __Pyx_DOCSTR(0)}, +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9TrieTable_count(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_5count_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_5count_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9TrieTable_root(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_1__get__(o); +} + +static int __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_root(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_3__set__(o, v); + } + else { + return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_TrieTable[] = { {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_Rule[] = { - {(char *)"f", __pyx_getprop_4cdec_2sa_3_sa_4Rule_f, 0, 0, 0}, - {(char *)"e", __pyx_getprop_4cdec_2sa_3_sa_4Rule_e, 0, 0, 0}, +static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_TrieTable[] = { + {(char *)"extended", __pyx_getprop_4cdec_2sa_3_sa_9TrieTable_extended, __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_extended, 0, 0}, + {(char *)"count", __pyx_getprop_4cdec_2sa_3_sa_9TrieTable_count, __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_count, 0, 0}, + {(char *)"root", __pyx_getprop_4cdec_2sa_3_sa_9TrieTable_root, __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_root, 0, 0}, {0, 0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Rule = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieTable = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.Rule"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Rule), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.TrieTable"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_TrieTable), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_Rule, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieTable, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 - __pyx_pw_4cdec_2sa_3_sa_4Rule_5__cmp__, /*tp_compare*/ + 0, /*tp_compare*/ #else 0, /*reserved*/ #endif @@ -69950,23 +72401,23 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Rule = { 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ - __pyx_pw_4cdec_2sa_3_sa_4Rule_3__hash__, /*tp_hash*/ + 0, /*tp_hash*/ 0, /*tp_call*/ - __pyx_pw_4cdec_2sa_3_sa_4Rule_11__str__, /*tp_str*/ + 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_Rule, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_Rule, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_TrieTable, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_TrieTable, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_Rule, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_TrieTable, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_4cdec_2sa_3_sa_Rule, /*tp_getset*/ + __pyx_getsets_4cdec_2sa_3_sa_TrieTable, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -69974,7 +72425,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Rule = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_Rule, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_TrieTable, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -69986,86 +72437,70 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Rule = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_PhraseLocation __pyx_vtable_4cdec_2sa_3_sa_PhraseLocation; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_PhraseLocation(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *p; PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation; + p->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_word = 0; - p->__pyx_t_0 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_word); - Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_PhraseLocation(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *p = (struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arr); + (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_PhraseLocation(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_word) { - e = (*v)(p->__pyx_v_word, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *p = (struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)o; + if (p->arr) { + e = (*v)(((PyObject*)p->arr), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_PhraseLocation(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_word); - p->__pyx_v_word = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *p = (struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)o; + tmp = ((PyObject*)p->arr); + p->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr[] = { +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_PhraseLocation[] = { {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_PhraseLocation = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_20_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.PhraseLocation"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_PhraseLocation, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -70084,15 +72519,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_PhraseLocation, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_PhraseLocation, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_PhraseLocation, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -70102,7 +72537,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_PhraseLocation, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -70114,72 +72549,69 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Precomputation __pyx_vtable_4cdec_2sa_3_sa_Precomputation; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Precomputation(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Sampler(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_Sampler *p; PyObject *o; - o = (*t->tp_alloc)(t, 0); + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_Precomputation; - p->precomputed_index = Py_None; Py_INCREF(Py_None); - p->precomputed_collocations = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_14Precomputation_1__cinit__(o, a, k) < 0)) { + p = ((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)o); + p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Precomputation(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *p = (struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Sampler(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_Sampler *p = (struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->precomputed_index); - Py_CLEAR(p->precomputed_collocations); + Py_CLEAR(p->sa); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_Precomputation(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_Sampler(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *p = (struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)o; - if (p->precomputed_index) { - e = (*v)(p->precomputed_index, a); if (e) return e; - } - if (p->precomputed_collocations) { - e = (*v)(p->precomputed_collocations, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_Sampler *p = (struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)o; + if (p->sa) { + e = (*v)(((PyObject*)p->sa), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa_Precomputation(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *p = (struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_Sampler(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->precomputed_index); - p->precomputed_index = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->precomputed_collocations); - p->precomputed_collocations = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_Sampler *p = (struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)o; + tmp = ((PyObject*)p->sa); + p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Precomputation[] = { - {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_14Precomputation_3read_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_14Precomputation_5write_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("precompute"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_14Precomputation_7precompute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Sampler[] = { + {__Pyx_NAMESTR("sample"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7Sampler_3sample, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_7Sampler_2sample)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Precomputation = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Sampler = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.Precomputation"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.Sampler"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Sampler), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_Precomputation, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_Sampler, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -70199,14 +72631,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Precomputation = { 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_Precomputation, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_Precomputation, /*tp_clear*/ + __Pyx_DOCSTR("A Sampler implements a logic for choosing\n samples from a population range"), /*tp_doc*/ + __pyx_tp_traverse_4cdec_2sa_3_sa_Sampler, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_Sampler, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_Precomputation, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_Sampler, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -70216,7 +72648,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Precomputation = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_Precomputation, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_Sampler, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -70228,262 +72660,223 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Precomputation = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory __pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_HieroCachingRuleFactory(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *p; PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_HieroCachingRuleFactory; + p->rules = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)Py_None); Py_INCREF(Py_None); + p->sampler = ((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)Py_None); Py_INCREF(Py_None); + p->scorer = ((struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)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_4cdec_2sa_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); + p->fda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); + p->eda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); + p->alignment = ((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)Py_None); Py_INCREF(Py_None); + p->eid2symid = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->fid2symid = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->findexes = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->findexes1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->online_stats = Py_None; Py_INCREF(Py_None); + p->bilex = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o); - p->__pyx_v_self = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_self); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_HieroCachingRuleFactory(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->rules); + Py_CLEAR(p->sampler); + Py_CLEAR(p->scorer); + Py_CLEAR(p->precomputed_index); + Py_CLEAR(p->precomputed_collocations); + Py_CLEAR(p->precompute_file); + Py_CLEAR(p->max_rank); + Py_CLEAR(p->prev_norm_prefix); + Py_CLEAR(p->fsa); + Py_CLEAR(p->fda); + Py_CLEAR(p->eda); + Py_CLEAR(p->alignment); + Py_CLEAR(p->eid2symid); + Py_CLEAR(p->fid2symid); + Py_CLEAR(p->findexes); + Py_CLEAR(p->findexes1); + Py_CLEAR(p->online_stats); + Py_CLEAR(p->bilex); + (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa_HieroCachingRuleFactory(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o; - if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)o; + if (p->rules) { + e = (*v)(((PyObject*)p->rules), a); if (e) return e; } - return 0; -} - -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o; - PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_27___iter__"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_27___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*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*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_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*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 - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *p; - PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance)); - PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + if (p->sampler) { + e = (*v)(((PyObject*)p->sampler), a); if (e) return e; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o); - p->__pyx_v_al = 0; - p->__pyx_v_cover = 0; - p->__pyx_v_e_nt_cover = 0; - p->__pyx_v_e_words = 0; - p->__pyx_v_ef_span = 0; - p->__pyx_v_extract = 0; - p->__pyx_v_f_len = 0; - p->__pyx_v_f_words = 0; - p->__pyx_v_fe_span = 0; - p->__pyx_v_rules = 0; - p->__pyx_v_self = 0; - return o; -} - -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_al); - Py_CLEAR(p->__pyx_v_cover); - Py_CLEAR(p->__pyx_v_e_nt_cover); - Py_CLEAR(p->__pyx_v_e_words); - Py_CLEAR(p->__pyx_v_ef_span); - Py_CLEAR(p->__pyx_v_extract); - Py_CLEAR(p->__pyx_v_f_len); - Py_CLEAR(p->__pyx_v_f_words); - Py_CLEAR(p->__pyx_v_fe_span); - Py_CLEAR(p->__pyx_v_rules); - Py_CLEAR(p->__pyx_v_self); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); + if (p->scorer) { + e = (*v)(((PyObject*)p->scorer), a); if (e) return e; } -} - -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o; - if (p->__pyx_v_al) { - e = (*v)(p->__pyx_v_al, a); if (e) return e; + if (p->precomputed_index) { + e = (*v)(p->precomputed_index, a); if (e) return e; } - if (p->__pyx_v_cover) { - e = (*v)(p->__pyx_v_cover, a); if (e) return e; + if (p->precomputed_collocations) { + e = (*v)(p->precomputed_collocations, a); if (e) return e; } - if (p->__pyx_v_e_nt_cover) { - e = (*v)(p->__pyx_v_e_nt_cover, a); if (e) return e; + if (p->precompute_file) { + e = (*v)(p->precompute_file, a); if (e) return e; } - if (p->__pyx_v_e_words) { - e = (*v)(p->__pyx_v_e_words, a); if (e) return e; + if (p->max_rank) { + e = (*v)(p->max_rank, a); if (e) return e; } - if (p->__pyx_v_ef_span) { - e = (*v)(p->__pyx_v_ef_span, a); if (e) return e; + if (p->prev_norm_prefix) { + e = (*v)(p->prev_norm_prefix, a); if (e) return e; } - if (p->__pyx_v_extract) { - e = (*v)(p->__pyx_v_extract, a); if (e) return e; + if (p->fsa) { + e = (*v)(((PyObject*)p->fsa), a); if (e) return e; } - if (p->__pyx_v_f_len) { - e = (*v)(p->__pyx_v_f_len, a); if (e) return e; + if (p->fda) { + e = (*v)(((PyObject*)p->fda), a); if (e) return e; } - if (p->__pyx_v_f_words) { - e = (*v)(p->__pyx_v_f_words, a); if (e) return e; + if (p->eda) { + e = (*v)(((PyObject*)p->eda), a); if (e) return e; } - if (p->__pyx_v_fe_span) { - e = (*v)(p->__pyx_v_fe_span, a); if (e) return e; + if (p->alignment) { + e = (*v)(((PyObject*)p->alignment), a); if (e) return e; } - if (p->__pyx_v_rules) { - e = (*v)(p->__pyx_v_rules, a); if (e) return e; + if (p->eid2symid) { + e = (*v)(((PyObject*)p->eid2symid), a); if (e) return e; } - if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + if (p->fid2symid) { + e = (*v)(((PyObject*)p->fid2symid), a); if (e) return e; + } + if (p->findexes) { + e = (*v)(((PyObject*)p->findexes), a); if (e) return e; + } + if (p->findexes1) { + e = (*v)(((PyObject*)p->findexes1), a); if (e) return e; + } + if (p->online_stats) { + e = (*v)(p->online_stats, a); if (e) return e; + } + if (p->bilex) { + e = (*v)(p->bilex, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa_HieroCachingRuleFactory(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_al); - p->__pyx_v_al = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)o; + tmp = ((PyObject*)p->rules); + p->rules = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_cover); - p->__pyx_v_cover = ((PyObject*)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->sampler); + p->sampler = ((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_e_nt_cover); - p->__pyx_v_e_nt_cover = ((PyObject*)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->scorer); + p->scorer = ((struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_e_words); - p->__pyx_v_e_words = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->precomputed_index); + p->precomputed_index = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_ef_span); - p->__pyx_v_ef_span = ((PyObject*)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->precomputed_collocations); + p->precomputed_collocations = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_extract); - p->__pyx_v_extract = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->precompute_file); + p->precompute_file = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_f_len); - p->__pyx_v_f_len = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->max_rank); + p->max_rank = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_f_words); - p->__pyx_v_f_words = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->prev_norm_prefix); + p->prev_norm_prefix = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_fe_span); - p->__pyx_v_fe_span = ((PyObject*)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->fsa); + p->fsa = ((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_rules); - p->__pyx_v_rules = ((PyObject*)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->fda); + p->fda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->eda); + p->eda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->alignment); + p->alignment = ((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->eid2symid); + p->eid2symid = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->fid2symid); + p->fid2symid = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->findexes); + p->findexes = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->findexes1); + p->findexes1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->online_stats); + p->online_stats = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->bilex); + p->bilex = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance[] = { +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_HieroCachingRuleFactory[] = { + {__Pyx_NAMESTR("configure"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure)}, + {__Pyx_NAMESTR("pattern2phrase"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5pattern2phrase, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("pattern2phrase_plus"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("precompute"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9precompute, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_precomputed_collocation"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_11get_precomputed_collocation, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("advance"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_all_nodes_isteps_away"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_away, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("reachable"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("shortest"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_next_states"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_states, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("input"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input)}, + {__Pyx_NAMESTR("add_instance"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instance, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("form_rule"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("fmt_rule"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("online_ctx_lookup"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_f_phrases"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_34get_f_phrases, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("drop_ctx"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_21_add_instance"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.HieroCachingRuleFactory"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_HieroCachingRuleFactory, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -70502,15 +72895,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_clear*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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_4cdec_2sa_3_sa_HieroCachingRuleFactory, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_HieroCachingRuleFactory, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_HieroCachingRuleFactory, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -70520,7 +72913,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_HieroCachingRuleFactory, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -70532,51 +72925,67 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap __pyx_vtable_4cdec_2sa_3_sa_TrieMap; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer __pyx_vtable_4cdec_2sa_3_sa_Scorer; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_TrieMap(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Scorer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_4cdec_2sa_3_sa_Scorer *p; PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_TrieMap; - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_7TrieMap_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)o); + p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_Scorer; + p->models = Py_None; Py_INCREF(Py_None); return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieMap(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_4cdec_2sa_3_sa_7TrieMap_3__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Scorer(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa_Scorer *p = (struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->models); (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_TrieMap[] = { - {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7TrieMap_5insert, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("contains"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7TrieMap_7contains, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("toMap"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7TrieMap_9toMap, METH_O, __Pyx_DOCSTR(0)}, +static int __pyx_tp_traverse_4cdec_2sa_3_sa_Scorer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4cdec_2sa_3_sa_Scorer *p = (struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)o; + if (p->models) { + e = (*v)(p->models, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_4cdec_2sa_3_sa_Scorer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa_Scorer *p = (struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)o; + tmp = ((PyObject*)p->models); + p->models = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Scorer[] = { {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieMap = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Scorer = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.TrieMap"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.Scorer"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Scorer), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieMap, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa_Scorer, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -70595,15 +73004,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieMap = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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_4cdec_2sa_3_sa_Scorer, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa_Scorer, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_TrieMap, /*tp_methods*/ + __pyx_methods_4cdec_2sa_3_sa_Scorer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -70611,9 +73020,9 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieMap = { 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - 0, /*tp_init*/ + __pyx_pw_4cdec_2sa_3_sa_6Scorer_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_TrieMap, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa_Scorer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -70625,86 +73034,63 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieMap = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct____iter__[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct____iter__ = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct____iter__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct____iter__]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o); - p->__pyx_v_point = 0; - p->__pyx_v_self = 0; - p->__pyx_t_0 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct____iter__(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_point); Py_CLEAR(p->__pyx_v_self); - Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct____iter__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct____iter__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o; - if (p->__pyx_v_point) { - e = (*v)(p->__pyx_v_point, a); if (e) return e; - } + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *)o; if (p->__pyx_v_self) { e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; - } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct____iter__(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_point); - p->__pyx_v_point = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *)o; tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct____iter__ = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_18_alignments"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct____iter__"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct____iter__, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -70725,13 +73111,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct____iter__, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct____iter__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -70741,7 +73127,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct____iter__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -70753,33 +73139,63 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_VEBIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_VEBIterator(PyObject *o) { - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_fp); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_VEBIterator[] = { - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11VEBIterator_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)o; + if (p->__pyx_v_fp) { + e = (*v)(p->__pyx_v_fp, a); if (e) return e; + } + return 0; +} -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_VEBIterator = { +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)o; + tmp = ((PyObject*)p->__pyx_v_fp); + p->__pyx_v_fp = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.VEBIterator"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_VEBIterator), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_1_read_bitext"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_VEBIterator, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -70798,15 +73214,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_VEBIterator = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ - __pyx_pw_4cdec_2sa_3_sa_11VEBIterator_1__next__, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_VEBIterator, /*tp_methods*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -70816,7 +73232,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_VEBIterator = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_VEBIterator, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -70828,54 +73244,49 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_VEBIterator = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = 0; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *p; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_word = 0; - p->__pyx_t_0 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_word); + Py_CLEAR(p->__pyx_v_line); Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *)o); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *)o; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; } - if (p->__pyx_v_word) { - e = (*v)(p->__pyx_v_word, a); if (e) return e; + if (p->__pyx_v_line) { + e = (*v)(p->__pyx_v_line, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; @@ -70883,14 +73294,14 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyObjec return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr(PyObject *o) { PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *)o; tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)Py_None); Py_INCREF(Py_None); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_word); - p->__pyx_v_word = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_line); + p->__pyx_v_line = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_t_0); p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); @@ -70898,16 +73309,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyObject * return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_5_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_2_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -70928,13 +73335,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -70944,7 +73351,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -70956,88 +73363,98 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList __pyx_vtable_4cdec_2sa_3_sa_FloatList; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_FloatList(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_FloatList *p; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_FloatList; - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_9FloatList_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_FloatList(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_4cdec_2sa_3_sa_9FloatList_3__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_ngram); + Py_CLEAR(p->__pyx_v_ngram_start); + Py_CLEAR(p->__pyx_v_ngram_starts); + Py_CLEAR(p->__pyx_v_run_start); + Py_CLEAR(p->__pyx_v_self); + Py_CLEAR(p->__pyx_v_veb); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); } - (*Py_TYPE(o)->tp_free)(o); -} -static PyObject *__pyx_sq_item_4cdec_2sa_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_4cdec_2sa_3_sa_FloatList(PyObject *o, PyObject *i, PyObject *v) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_9FloatList_7__setitem__(o, i, v); +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *)o; + if (p->__pyx_v_ngram) { + e = (*v)(p->__pyx_v_ngram, a); if (e) return e; } - else { - PyErr_Format(PyExc_NotImplementedError, - "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name); - return -1; + if (p->__pyx_v_ngram_start) { + e = (*v)(((PyObject*)p->__pyx_v_ngram_start), a); if (e) return e; + } + if (p->__pyx_v_ngram_starts) { + e = (*v)(p->__pyx_v_ngram_starts, a); if (e) return e; + } + if (p->__pyx_v_run_start) { + e = (*v)(((PyObject*)p->__pyx_v_run_start), a); if (e) return e; + } + if (p->__pyx_v_self) { + e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + } + if (p->__pyx_v_veb) { + e = (*v)(((PyObject*)p->__pyx_v_veb), a); if (e) return e; } + return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_FloatList[] = { - {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9FloatList_11append, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9FloatList_13write, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9FloatList_15read, METH_O, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static PySequenceMethods __pyx_tp_as_sequence_FloatList = { - __pyx_pw_4cdec_2sa_3_sa_9FloatList_9__len__, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_4cdec_2sa_3_sa_FloatList, /*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_FloatList = { - __pyx_pw_4cdec_2sa_3_sa_9FloatList_9__len__, /*mp_length*/ - __pyx_pw_4cdec_2sa_3_sa_9FloatList_5__getitem__, /*mp_subscript*/ - __pyx_mp_ass_subscript_4cdec_2sa_3_sa_FloatList, /*mp_ass_subscript*/ -}; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *)o; + 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_4cdec_2sa_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_4cdec_2sa_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_4cdec_2sa_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_4cdec_2sa_3_sa_VEB *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_FloatList = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.FloatList"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_FloatList), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_3_compute_stats"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_FloatList, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -71048,23 +73465,23 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_FloatList = { #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_FloatList, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_FloatList, /*tp_as_mapping*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_FloatList, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -71074,7 +73491,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_FloatList = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_FloatList, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -71086,48 +73503,70 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_FloatList = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap __pyx_vtable_4cdec_2sa_3_sa_StringMap; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_StringMap(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_StringMap *p; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_StringMap; - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_9StringMap_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { - Py_DECREF(o); o = 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_StringMap(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_4cdec_2sa_3_sa_9StringMap_3__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_word_ids); + Py_CLEAR(p->__pyx_v_words); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); } - (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_StringMap[] = { - {0, 0, 0, 0} -}; +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)o; + if (p->__pyx_v_word_ids) { + e = (*v)(p->__pyx_v_word_ids, a); if (e) return e; + } + if (p->__pyx_v_words) { + e = (*v)(p->__pyx_v_words, a); if (e) return e; + } + return 0; +} -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_StringMap = { +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)o; + tmp = ((PyObject*)p->__pyx_v_word_ids); + p->__pyx_v_word_ids = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_words); + p->__pyx_v_words = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.StringMap"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_StringMap), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_4_make_lattice"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_StringMap, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -71146,15 +73585,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_StringMap = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_StringMap, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -71164,7 +73603,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_StringMap = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_StringMap, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -71176,70 +73615,77 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_StringMap = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *)o); - p->__pyx_v_self = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_self); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *)o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_word); + Py_CLEAR(p->__pyx_t_0); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *)o; - if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_word) { + e = (*v)(p->__pyx_v_word, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_word); + p->__pyx_v_word = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_15___iter__"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_5_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -71260,13 +73706,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -71276,7 +73722,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -71288,70 +73734,77 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16___str__[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16___str__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o); - p->__pyx_v_self = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_self); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16___str__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_word); + Py_CLEAR(p->__pyx_t_0); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o; - if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_word) { + e = (*v)(p->__pyx_v_word, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)Py_None); Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_word); + p->__pyx_v_word = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_16___str__[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_16___str__"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_6_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -71372,13 +73825,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -71388,7 +73841,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -71400,107 +73853,63 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_TrieTable(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *p; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)o); - p->root = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieTable(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->root); - (*Py_TYPE(o)->tp_free)(o); + Py_CLEAR(p->__pyx_v_lattice); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_TrieTable(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)o; - if (p->root) { - e = (*v)(p->root, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)o; + if (p->__pyx_v_lattice) { + e = (*v)(p->__pyx_v_lattice, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa_TrieTable(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *p = (struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->root); - p->root = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)o; + tmp = ((PyObject*)p->__pyx_v_lattice); + p->__pyx_v_lattice = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9TrieTable_extended(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_8extended_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_extended(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_8extended_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9TrieTable_count(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_5count_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_5count_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9TrieTable_root(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_root(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_3__set__(o, v); - } - else { - return __pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_TrieTable[] = { - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_TrieTable[] = { - {(char *)"extended", __pyx_getprop_4cdec_2sa_3_sa_9TrieTable_extended, __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_extended, 0, 0}, - {(char *)"count", __pyx_getprop_4cdec_2sa_3_sa_9TrieTable_count, __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_count, 0, 0}, - {(char *)"root", __pyx_getprop_4cdec_2sa_3_sa_9TrieTable_root, __pyx_setprop_4cdec_2sa_3_sa_9TrieTable_root, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieTable = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.TrieTable"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_TrieTable), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_7_decode_lattice"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_TrieTable, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -71519,17 +73928,17 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieTable = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_TrieTable, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_TrieTable, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_TrieTable, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_4cdec_2sa_3_sa_TrieTable, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -71537,7 +73946,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieTable = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_TrieTable, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -71549,70 +73958,119 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_TrieTable = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)o); - p->__pyx_v_words = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_words); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_arc); + Py_CLEAR(p->__pyx_v_dist); + Py_CLEAR(p->__pyx_v_node); + Py_CLEAR(p->__pyx_v_sym); + Py_CLEAR(p->__pyx_v_weight); + Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_t_3); + Py_CLEAR(p->__pyx_t_4); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)o; - if (p->__pyx_v_words) { - e = (*v)(p->__pyx_v_words, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_arc) { + e = (*v)(p->__pyx_v_arc, a); if (e) return e; + } + if (p->__pyx_v_dist) { + e = (*v)(p->__pyx_v_dist, a); if (e) return e; + } + if (p->__pyx_v_node) { + e = (*v)(p->__pyx_v_node, a); if (e) return e; + } + if (p->__pyx_v_sym) { + e = (*v)(p->__pyx_v_sym, a); if (e) return e; + } + if (p->__pyx_v_weight) { + e = (*v)(p->__pyx_v_weight, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, 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_4) { + e = (*v)(p->__pyx_t_4, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_words); - p->__pyx_v_words = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_arc); + p->__pyx_v_arc = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_dist); + p->__pyx_v_dist = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_node); + p->__pyx_v_node = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_sym); + p->__pyx_v_sym = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_weight); + p->__pyx_v_weight = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = 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); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_4); + p->__pyx_t_4 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_11_encode_words"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_8_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -71633,13 +74091,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -71649,7 +74107,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -71661,86 +74119,63 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_packed = 0; - p->__pyx_t_0 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_packed); - Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o); + Py_CLEAR(p->__pyx_v_lattice); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_packed) { - e = (*v)(p->__pyx_v_packed, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)o; + if (p->__pyx_v_lattice) { + e = (*v)(p->__pyx_v_lattice, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_packed); - p->__pyx_v_packed = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)o; + tmp = ((PyObject*)p->__pyx_v_lattice); + p->__pyx_v_lattice = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_25_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_9_decode_sentence"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -71761,13 +74196,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -71777,7 +74212,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -71789,54 +74224,53 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_word = 0; - p->__pyx_t_0 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_word); + Py_CLEAR(p->__pyx_v__); + Py_CLEAR(p->__pyx_v_sym); Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *)o); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *)o; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; } - if (p->__pyx_v_word) { - e = (*v)(p->__pyx_v_word, a); if (e) return e; + if (p->__pyx_v__) { + e = (*v)(p->__pyx_v__, a); if (e) return e; + } + if (p->__pyx_v_sym) { + e = (*v)(p->__pyx_v_sym, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; @@ -71844,14 +74278,17 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyObje return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr(PyObject *o) { PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *)o; tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)Py_None); Py_INCREF(Py_None); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_word); - p->__pyx_v_word = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v__); + p->__pyx_v__ = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_sym); + p->__pyx_v_sym = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_t_0); p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); @@ -71859,16 +74296,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyObject return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_12_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_10_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -71889,13 +74322,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -71905,7 +74338,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -71917,86 +74350,63 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_word = 0; - p->__pyx_t_0 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_word); - Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *)o); + Py_CLEAR(p->__pyx_v_words); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_word) { - e = (*v)(p->__pyx_v_word, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)o; + if (p->__pyx_v_words) { + e = (*v)(p->__pyx_v_words, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_word); - p->__pyx_v_word = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)o; + tmp = ((PyObject*)p->__pyx_v_words); + p->__pyx_v_words = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_6_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_11_encode_words"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -72017,13 +74427,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -72033,7 +74443,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -72045,78 +74455,77 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o); - p->__pyx_v_links = 0; - p->__pyx_v_self = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_links); - Py_CLEAR(p->__pyx_v_self); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_word); + Py_CLEAR(p->__pyx_t_0); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o; - if (p->__pyx_v_links) { - e = (*v)(p->__pyx_v_links, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; } - if (p->__pyx_v_self) { - e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + if (p->__pyx_v_word) { + e = (*v)(p->__pyx_v_word, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_links); - p->__pyx_v_links = ((PyObject*)Py_None); Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_word); + p->__pyx_v_word = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_22_form_rule"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_12_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -72137,13 +74546,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -72153,7 +74562,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -72165,94 +74574,63 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v__ = 0; - p->__pyx_v_sym = 0; - p->__pyx_t_0 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v__); - Py_CLEAR(p->__pyx_v_sym); - Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *)o); + Py_CLEAR(p->__pyx_v_syms); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v__) { - e = (*v)(p->__pyx_v__, a); if (e) return e; - } - if (p->__pyx_v_sym) { - e = (*v)(p->__pyx_v_sym, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)o; + if (p->__pyx_v_syms) { + e = (*v)(p->__pyx_v_syms, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v__); - p->__pyx_v__ = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_sym); - p->__pyx_v_sym = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)o; + tmp = ((PyObject*)p->__pyx_v_syms); + p->__pyx_v_syms = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_10_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_13_decode_words"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -72273,13 +74651,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -72289,7 +74667,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -72301,69 +74679,77 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB __pyx_vtable_4cdec_2sa_3_sa_VEB; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_VEB(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_VEB *p; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_VEB; - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_3VEB_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_VEB(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_4cdec_2sa_3_sa_3VEB_3__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_sym); + Py_CLEAR(p->__pyx_t_0); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_VEB[] = { - {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_3VEB_7insert, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("findsucc"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_3VEB_9findsucc, METH_O, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static PySequenceMethods __pyx_tp_as_sequence_VEB = { - __pyx_pw_4cdec_2sa_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*/ - __pyx_pw_4cdec_2sa_3_sa_3VEB_13__contains__, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_sym) { + e = (*v)(p->__pyx_v_sym, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + return 0; +} -static PyMappingMethods __pyx_tp_as_mapping_VEB = { - __pyx_pw_4cdec_2sa_3_sa_3VEB_11__len__, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_sym); + p->__pyx_v_sym = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_VEB = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.VEB"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_VEB), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_14_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_VEB, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -72374,23 +74760,23 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_VEB = { #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_VEB, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_VEB, /*tp_as_mapping*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pw_4cdec_2sa_3_sa_3VEB_5__iter__, /*tp_iter*/ + 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_VEB, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -72400,7 +74786,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_VEB = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_VEB, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -72412,70 +74798,63 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_VEB = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)o); - p->__pyx_v_lattice = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_lattice); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)o); + Py_CLEAR(p->__pyx_v_self); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)o; - if (p->__pyx_v_lattice) { - e = (*v)(p->__pyx_v_lattice, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___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_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_lattice); - p->__pyx_v_lattice = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ *)o; + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_7_decode_lattice"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_15___iter__"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -72496,13 +74875,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattic 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -72512,7 +74891,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattic 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -72524,61 +74903,63 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattic #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_PhraseLocation __pyx_vtable_4cdec_2sa_3_sa_PhraseLocation; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_PhraseLocation(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *p; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16___str__[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation; - p->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16___str__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_PhraseLocation(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *p = (struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->arr); - (*Py_TYPE(o)->tp_free)(o); + Py_CLEAR(p->__pyx_v_self); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16___str__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_PhraseLocation(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *p = (struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)o; - if (p->arr) { - e = (*v)(((PyObject*)p->arr), a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)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_4cdec_2sa_3_sa_PhraseLocation(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *p = (struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->arr); - p->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o; + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_PhraseLocation[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_PhraseLocation = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.PhraseLocation"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_16___str__"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_PhraseLocation, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -72597,15 +74978,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_PhraseLocation = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_PhraseLocation, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_PhraseLocation, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_PhraseLocation, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -72615,7 +74996,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_PhraseLocation = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_PhraseLocation, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -72627,58 +75008,77 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_PhraseLocation = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer __pyx_vtable_4cdec_2sa_3_sa_Scorer; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Scorer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_Scorer *p; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_Scorer; - p->models = Py_None; Py_INCREF(Py_None); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Scorer(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Scorer *p = (struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->models); - (*Py_TYPE(o)->tp_free)(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_a); + Py_CLEAR(p->__pyx_t_0); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_Scorer(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_Scorer *p = (struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)o; - if (p->models) { - e = (*v)(p->models, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_a) { + e = (*v)(p->__pyx_v_a, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa_Scorer(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Scorer *p = (struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->models); - p->models = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_a); + p->__pyx_v_a = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Scorer[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Scorer = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.Scorer"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Scorer), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_17_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_Scorer, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -72697,15 +75097,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Scorer = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_Scorer, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_Scorer, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_Scorer, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -72713,9 +75113,9 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Scorer = { 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pw_4cdec_2sa_3_sa_6Scorer_1__init__, /*tp_init*/ + 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_Scorer, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -72727,60 +75127,77 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Scorer = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Sampler(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_Sampler *p; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)o); - p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Sampler(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Sampler *p = (struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->sa); - (*Py_TYPE(o)->tp_free)(o); + Py_CLEAR(p->__pyx_v_point); + Py_CLEAR(p->__pyx_v_self); + Py_CLEAR(p->__pyx_t_0); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_Sampler(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_Sampler *p = (struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)o; - if (p->sa) { - e = (*v)(((PyObject*)p->sa), a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o; + if (p->__pyx_v_point) { + e = (*v)(p->__pyx_v_point, a); if (e) return e; + } + if (p->__pyx_v_self) { + e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa_Sampler(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Sampler *p = (struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->sa); - p->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o; + tmp = ((PyObject*)p->__pyx_v_point); + p->__pyx_v_point = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Sampler[] = { - {__Pyx_NAMESTR("sample"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_7Sampler_3sample, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_7Sampler_2sample)}, - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Sampler = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.Sampler"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Sampler), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_18_alignments"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_Sampler, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -72799,15 +75216,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Sampler = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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_4cdec_2sa_3_sa_Sampler, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_Sampler, /*tp_clear*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_Sampler, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -72817,7 +75234,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Sampler = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_Sampler, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -72829,516 +75246,469 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Sampler = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet __pyx_vtable_4cdec_2sa_3_sa_Alphabet; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_Alphabet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *p; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_input[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_Alphabet; - p->terminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); - p->nonterminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); - p->id2sym = ((PyObject*)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_8Alphabet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { - Py_DECREF(o); o = 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_input[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_Alphabet(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o; PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_4cdec_2sa_3_sa_8Alphabet_3__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); + Py_CLEAR(p->__pyx_v_alignment); + Py_CLEAR(p->__pyx_v_als); + Py_CLEAR(p->__pyx_v_alslist); + Py_CLEAR(p->__pyx_v_chunklen); + Py_CLEAR(p->__pyx_v_count); + Py_CLEAR(p->__pyx_v_ctx_name); + Py_CLEAR(p->__pyx_v_e); + Py_CLEAR(p->__pyx_v_elist); + Py_CLEAR(p->__pyx_v_extract); + Py_CLEAR(p->__pyx_v_extract_start); + Py_CLEAR(p->__pyx_v_extract_stop); + Py_CLEAR(p->__pyx_v_extracts); + Py_CLEAR(p->__pyx_v_f); + Py_CLEAR(p->__pyx_v_f_syms); + Py_CLEAR(p->__pyx_v_fcount); + Py_CLEAR(p->__pyx_v_fphrases); + Py_CLEAR(p->__pyx_v_frontier); + Py_CLEAR(p->__pyx_v_frontier_nodes); + Py_CLEAR(p->__pyx_v_fwords); + Py_CLEAR(p->__pyx_v_genexpr); + Py_CLEAR(p->__pyx_v_hiero_phrase); + Py_CLEAR(p->__pyx_v_input_match); + Py_CLEAR(p->__pyx_v_intersect_start_time); + Py_CLEAR(p->__pyx_v_intersect_stop_time); + Py_CLEAR(p->__pyx_v_is_shadow_path); + Py_CLEAR(p->__pyx_v_key); + Py_CLEAR(p->__pyx_v_lex_i); + Py_CLEAR(p->__pyx_v_lex_j); + Py_CLEAR(p->__pyx_v_loc); + Py_CLEAR(p->__pyx_v_locs); + Py_CLEAR(p->__pyx_v_max_locs); + Py_CLEAR(p->__pyx_v_meta); + Py_CLEAR(p->__pyx_v_new_frontier); + Py_CLEAR(p->__pyx_v_new_node); + Py_CLEAR(p->__pyx_v_next_states); + Py_CLEAR(p->__pyx_v_node); + Py_CLEAR(p->__pyx_v_nodes_isteps_away_buffer); + Py_CLEAR(p->__pyx_v_pathlen); + Py_CLEAR(p->__pyx_v_phrase); + Py_CLEAR(p->__pyx_v_phrase_location); + Py_CLEAR(p->__pyx_v_prefix); + Py_CLEAR(p->__pyx_v_reachable_buffer); + Py_CLEAR(p->__pyx_v_sa_range); + Py_CLEAR(p->__pyx_v_sample); + Py_CLEAR(p->__pyx_v_scores); + Py_CLEAR(p->__pyx_v_seen_phrases); + Py_CLEAR(p->__pyx_v_self); + Py_CLEAR(p->__pyx_v_spanlen); + Py_CLEAR(p->__pyx_v_stats); + Py_CLEAR(p->__pyx_v_stop_time); + Py_CLEAR(p->__pyx_v_suffix_link); + Py_CLEAR(p->__pyx_v_suffix_link_xcat_index); + Py_CLEAR(p->__pyx_v_word_id); + Py_CLEAR(p->__pyx_v_xcat_index); + Py_CLEAR(p->__pyx_v_xnode); + Py_CLEAR(p->__pyx_v_xroot); + Py_CLEAR(p->__pyx_t_3); + Py_CLEAR(p->__pyx_t_4); + Py_CLEAR(p->__pyx_t_5); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_input[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); } - Py_CLEAR(p->terminals); - Py_CLEAR(p->nonterminals); - Py_CLEAR(p->id2sym); - (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_Alphabet(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)o; - if (p->terminals) { - e = (*v)(((PyObject*)p->terminals), a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o; + if (p->__pyx_v_alignment) { + e = (*v)(p->__pyx_v_alignment, a); if (e) return e; } - if (p->nonterminals) { - e = (*v)(((PyObject*)p->nonterminals), a); if (e) return e; + if (p->__pyx_v_als) { + e = (*v)(p->__pyx_v_als, a); if (e) return e; } - if (p->id2sym) { - e = (*v)(p->id2sym, a); if (e) return e; + if (p->__pyx_v_alslist) { + e = (*v)(p->__pyx_v_alslist, a); if (e) return e; } - return 0; -} - -static int __pyx_tp_clear_4cdec_2sa_3_sa_Alphabet(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *p = (struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *)o; - PyObject* tmp; - tmp = ((PyObject*)p->terminals); - p->terminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->nonterminals); - p->nonterminals = ((struct __pyx_obj_4cdec_2sa_3_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_4cdec_2sa_3_sa_8Alphabet_terminals(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_8Alphabet_9terminals_1__get__(o); -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_8Alphabet_nonterminals(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_8Alphabet_12nonterminals_1__get__(o); -} - -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Alphabet[] = { - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_Alphabet[] = { - {(char *)"terminals", __pyx_getprop_4cdec_2sa_3_sa_8Alphabet_terminals, 0, 0, 0}, - {(char *)"nonterminals", __pyx_getprop_4cdec_2sa_3_sa_8Alphabet_nonterminals, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_Alphabet = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.Alphabet"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Alphabet), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_Alphabet, /*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*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_Alphabet, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_Alphabet, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_Alphabet, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_4cdec_2sa_3_sa_Alphabet, /*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_4cdec_2sa_3_sa_Alphabet, /*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 - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_BiLex __pyx_vtable_4cdec_2sa_3_sa_BiLex; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BiLex(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_BiLex *p; - PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_BiLex; - p->col1 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); - p->col2 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); - p->f_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->e_index = ((struct __pyx_obj_4cdec_2sa_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 (unlikely(__pyx_pw_4cdec_2sa_3_sa_5BiLex_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; + if (p->__pyx_v_chunklen) { + e = (*v)(((PyObject*)p->__pyx_v_chunklen), a); if (e) return e; } - return o; -} - -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_BiLex(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_BiLex *p = (struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->col1); - Py_CLEAR(p->col2); - Py_CLEAR(p->f_index); - Py_CLEAR(p->e_index); - Py_CLEAR(p->id2eword); - Py_CLEAR(p->id2fword); - Py_CLEAR(p->eword2id); - Py_CLEAR(p->fword2id); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_4cdec_2sa_3_sa_BiLex(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4cdec_2sa_3_sa_BiLex *p = (struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)o; - if (p->col1) { - e = (*v)(((PyObject*)p->col1), a); if (e) return e; + if (p->__pyx_v_count) { + e = (*v)(p->__pyx_v_count, a); if (e) return e; } - if (p->col2) { - e = (*v)(((PyObject*)p->col2), a); if (e) return e; + if (p->__pyx_v_ctx_name) { + e = (*v)(p->__pyx_v_ctx_name, a); if (e) return e; } - if (p->f_index) { - e = (*v)(((PyObject*)p->f_index), a); if (e) return e; + if (p->__pyx_v_e) { + e = (*v)(p->__pyx_v_e, a); if (e) return e; } - if (p->e_index) { - e = (*v)(((PyObject*)p->e_index), a); if (e) return e; + if (p->__pyx_v_elist) { + e = (*v)(p->__pyx_v_elist, a); if (e) return e; } - if (p->id2eword) { - e = (*v)(p->id2eword, a); if (e) return e; + if (p->__pyx_v_extract) { + e = (*v)(p->__pyx_v_extract, a); if (e) return e; } - if (p->id2fword) { - e = (*v)(p->id2fword, a); if (e) return e; + if (p->__pyx_v_extract_start) { + e = (*v)(p->__pyx_v_extract_start, a); if (e) return e; } - if (p->eword2id) { - e = (*v)(p->eword2id, a); if (e) return e; + if (p->__pyx_v_extract_stop) { + e = (*v)(p->__pyx_v_extract_stop, a); if (e) return e; } - if (p->fword2id) { - e = (*v)(p->fword2id, a); if (e) return e; + if (p->__pyx_v_extracts) { + e = (*v)(p->__pyx_v_extracts, a); if (e) return e; } - return 0; -} - -static int __pyx_tp_clear_4cdec_2sa_3_sa_BiLex(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_BiLex *p = (struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)o; - PyObject* tmp; - tmp = ((PyObject*)p->col1); - p->col1 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->col2); - p->col2 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->f_index); - p->f_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->e_index); - p->e_index = ((struct __pyx_obj_4cdec_2sa_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_4cdec_2sa_3_sa_BiLex[] = { - {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_3write_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_5read_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("contains_e_word"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_7contains_e_word, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("contains_f_word"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_9contains_f_word, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_e_id"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_11get_e_id, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_f_id"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_13get_f_id, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_15read_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_17write_enhanced, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_score"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_19get_score, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_5BiLex_21write_text, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_5BiLex_20write_text)}, - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BiLex = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.BiLex"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_BiLex), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_BiLex, /*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*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_BiLex, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_BiLex, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_BiLex, /*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_4cdec_2sa_3_sa_BiLex, /*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 - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray __pyx_vtable_4cdec_2sa_3_sa_DataArray; - -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_DataArray(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_DataArray *p; - PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_DataArray; - p->word2id = Py_None; Py_INCREF(Py_None); - p->id2word = Py_None; Py_INCREF(Py_None); - p->data = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->sent_id = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_9DataArray_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; + if (p->__pyx_v_f) { + e = (*v)(p->__pyx_v_f, a); if (e) return e; } - return o; -} - -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_DataArray(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_DataArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->word2id); - Py_CLEAR(p->id2word); - Py_CLEAR(p->data); - Py_CLEAR(p->sent_id); - Py_CLEAR(p->sent_index); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_4cdec_2sa_3_sa_DataArray(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4cdec_2sa_3_sa_DataArray *p = (struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)o; - if (p->word2id) { - e = (*v)(p->word2id, a); if (e) return e; + if (p->__pyx_v_f_syms) { + e = (*v)(p->__pyx_v_f_syms, a); if (e) return e; } - if (p->id2word) { - e = (*v)(p->id2word, a); if (e) return e; + if (p->__pyx_v_fcount) { + e = (*v)(p->__pyx_v_fcount, a); if (e) return e; } - if (p->data) { - e = (*v)(((PyObject*)p->data), a); if (e) return e; + if (p->__pyx_v_fphrases) { + e = (*v)(p->__pyx_v_fphrases, a); if (e) return e; } - if (p->sent_id) { - e = (*v)(((PyObject*)p->sent_id), a); if (e) return e; + if (p->__pyx_v_frontier) { + e = (*v)(p->__pyx_v_frontier, a); if (e) return e; } - if (p->sent_index) { - e = (*v)(((PyObject*)p->sent_index), a); if (e) return e; + if (p->__pyx_v_frontier_nodes) { + e = (*v)(p->__pyx_v_frontier_nodes, a); if (e) return e; } - return 0; -} - -static int __pyx_tp_clear_4cdec_2sa_3_sa_DataArray(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_DataArray *p = (struct __pyx_obj_4cdec_2sa_3_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_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->sent_id); - p->sent_id = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->sent_index); - p->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} -static PyObject *__pyx_sq_item_4cdec_2sa_3_sa_DataArray(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 PyObject *__pyx_getprop_4cdec_2sa_3_sa_9DataArray_word2id(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_9DataArray_word2id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_3__set__(o, v); + if (p->__pyx_v_fwords) { + e = (*v)(p->__pyx_v_fwords, a); if (e) return e; } - else { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7word2id_5__del__(o); + if (p->__pyx_v_genexpr) { + e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9DataArray_id2word(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_9DataArray_id2word(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_3__set__(o, v); + if (p->__pyx_v_hiero_phrase) { + e = (*v)(((PyObject*)p->__pyx_v_hiero_phrase), a); if (e) return e; } - else { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7id2word_5__del__(o); + if (p->__pyx_v_input_match) { + e = (*v)(p->__pyx_v_input_match, a); if (e) return e; } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9DataArray_data(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_9DataArray_data(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_3__set__(o, v); + if (p->__pyx_v_intersect_start_time) { + e = (*v)(p->__pyx_v_intersect_start_time, a); if (e) return e; } - else { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_4data_5__del__(o); + if (p->__pyx_v_intersect_stop_time) { + e = (*v)(p->__pyx_v_intersect_stop_time, a); if (e) return e; } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9DataArray_sent_id(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_9DataArray_sent_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_3__set__(o, v); + if (p->__pyx_v_is_shadow_path) { + e = (*v)(p->__pyx_v_is_shadow_path, a); if (e) return e; } - else { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_7sent_id_5__del__(o); + if (p->__pyx_v_key) { + e = (*v)(p->__pyx_v_key, a); if (e) return e; } -} - -static PyObject *__pyx_getprop_4cdec_2sa_3_sa_9DataArray_sent_index(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_1__get__(o); -} - -static int __pyx_setprop_4cdec_2sa_3_sa_9DataArray_sent_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_3__set__(o, v); + if (p->__pyx_v_lex_i) { + e = (*v)(p->__pyx_v_lex_i, a); if (e) return e; } - else { - return __pyx_pw_4cdec_2sa_3_sa_9DataArray_10sent_index_5__del__(o); + if (p->__pyx_v_lex_j) { + e = (*v)(p->__pyx_v_lex_j, a); if (e) return e; + } + if (p->__pyx_v_loc) { + e = (*v)(p->__pyx_v_loc, a); if (e) return e; + } + if (p->__pyx_v_locs) { + e = (*v)(p->__pyx_v_locs, a); if (e) return e; + } + if (p->__pyx_v_max_locs) { + e = (*v)(p->__pyx_v_max_locs, a); if (e) return e; + } + if (p->__pyx_v_meta) { + e = (*v)(p->__pyx_v_meta, a); if (e) return e; + } + if (p->__pyx_v_new_frontier) { + e = (*v)(p->__pyx_v_new_frontier, a); if (e) return e; + } + if (p->__pyx_v_new_node) { + e = (*v)(p->__pyx_v_new_node, a); if (e) return e; } + if (p->__pyx_v_next_states) { + e = (*v)(p->__pyx_v_next_states, a); if (e) return e; + } + if (p->__pyx_v_node) { + e = (*v)(p->__pyx_v_node, a); if (e) return e; + } + if (p->__pyx_v_nodes_isteps_away_buffer) { + e = (*v)(p->__pyx_v_nodes_isteps_away_buffer, a); if (e) return e; + } + if (p->__pyx_v_pathlen) { + e = (*v)(p->__pyx_v_pathlen, a); if (e) return e; + } + if (p->__pyx_v_phrase) { + e = (*v)(p->__pyx_v_phrase, a); if (e) return e; + } + if (p->__pyx_v_phrase_location) { + e = (*v)(((PyObject*)p->__pyx_v_phrase_location), a); if (e) return e; + } + if (p->__pyx_v_prefix) { + e = (*v)(p->__pyx_v_prefix, a); if (e) return e; + } + if (p->__pyx_v_reachable_buffer) { + e = (*v)(p->__pyx_v_reachable_buffer, a); if (e) return e; + } + if (p->__pyx_v_sa_range) { + e = (*v)(p->__pyx_v_sa_range, a); if (e) return e; + } + if (p->__pyx_v_sample) { + e = (*v)(((PyObject*)p->__pyx_v_sample), a); if (e) return e; + } + if (p->__pyx_v_scores) { + e = (*v)(((PyObject*)p->__pyx_v_scores), a); if (e) return e; + } + if (p->__pyx_v_seen_phrases) { + e = (*v)(p->__pyx_v_seen_phrases, a); if (e) return e; + } + if (p->__pyx_v_self) { + e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + } + if (p->__pyx_v_spanlen) { + e = (*v)(p->__pyx_v_spanlen, a); if (e) return e; + } + if (p->__pyx_v_stats) { + e = (*v)(p->__pyx_v_stats, a); if (e) return e; + } + if (p->__pyx_v_stop_time) { + e = (*v)(p->__pyx_v_stop_time, a); if (e) return e; + } + if (p->__pyx_v_suffix_link) { + e = (*v)(p->__pyx_v_suffix_link, a); if (e) return e; + } + if (p->__pyx_v_suffix_link_xcat_index) { + e = (*v)(p->__pyx_v_suffix_link_xcat_index, a); if (e) return e; + } + if (p->__pyx_v_word_id) { + e = (*v)(p->__pyx_v_word_id, a); if (e) return e; + } + if (p->__pyx_v_xcat_index) { + e = (*v)(p->__pyx_v_xcat_index, a); if (e) return e; + } + if (p->__pyx_v_xnode) { + e = (*v)(p->__pyx_v_xnode, a); if (e) return e; + } + if (p->__pyx_v_xroot) { + e = (*v)(p->__pyx_v_xroot, 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_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 PyMethodDef __pyx_methods_4cdec_2sa_3_sa_DataArray[] = { - {__Pyx_NAMESTR("get_sentence_id"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_5get_sentence_id, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_sentence"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_7get_sentence, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_id"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_9get_id, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_sentence_bounds"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_13get_sentence_bounds, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_15write_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_17read_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_bitext"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_19read_bitext, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_text_data"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_21read_text_data, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_23read_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_25write_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_enhanced_handle"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_27write_enhanced_handle, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_9DataArray_29write_enhanced, METH_O, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_DataArray[] = { - {(char *)"word2id", __pyx_getprop_4cdec_2sa_3_sa_9DataArray_word2id, __pyx_setprop_4cdec_2sa_3_sa_9DataArray_word2id, 0, 0}, - {(char *)"id2word", __pyx_getprop_4cdec_2sa_3_sa_9DataArray_id2word, __pyx_setprop_4cdec_2sa_3_sa_9DataArray_id2word, 0, 0}, - {(char *)"data", __pyx_getprop_4cdec_2sa_3_sa_9DataArray_data, __pyx_setprop_4cdec_2sa_3_sa_9DataArray_data, 0, 0}, - {(char *)"sent_id", __pyx_getprop_4cdec_2sa_3_sa_9DataArray_sent_id, __pyx_setprop_4cdec_2sa_3_sa_9DataArray_sent_id, 0, 0}, - {(char *)"sent_index", __pyx_getprop_4cdec_2sa_3_sa_9DataArray_sent_index, __pyx_setprop_4cdec_2sa_3_sa_9DataArray_sent_index, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PySequenceMethods __pyx_tp_as_sequence_DataArray = { - __pyx_pw_4cdec_2sa_3_sa_9DataArray_3__len__, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_4cdec_2sa_3_sa_DataArray, /*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_DataArray = { - __pyx_pw_4cdec_2sa_3_sa_9DataArray_3__len__, /*mp_length*/ - __pyx_pw_4cdec_2sa_3_sa_9DataArray_11__getitem__, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o; + tmp = ((PyObject*)p->__pyx_v_alignment); + p->__pyx_v_alignment = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_als); + p->__pyx_v_als = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_alslist); + 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_4cdec_2sa_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); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_ctx_name); + p->__pyx_v_ctx_name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_e); + p->__pyx_v_e = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_elist); + p->__pyx_v_elist = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_extract); + p->__pyx_v_extract = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_extract_start); + p->__pyx_v_extract_start = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_extract_stop); + p->__pyx_v_extract_stop = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_extracts); + p->__pyx_v_extracts = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_f); + p->__pyx_v_f = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_f_syms); + p->__pyx_v_f_syms = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_fcount); + p->__pyx_v_fcount = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_fphrases); + p->__pyx_v_fphrases = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_frontier); + p->__pyx_v_frontier = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_frontier_nodes); + p->__pyx_v_frontier_nodes = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_fwords); + p->__pyx_v_fwords = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_genexpr); + p->__pyx_v_genexpr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_hiero_phrase); + p->__pyx_v_hiero_phrase = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_input_match); + p->__pyx_v_input_match = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_intersect_start_time); + p->__pyx_v_intersect_start_time = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_intersect_stop_time); + p->__pyx_v_intersect_stop_time = 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); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_key); + p->__pyx_v_key = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_lex_i); + p->__pyx_v_lex_i = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_lex_j); + p->__pyx_v_lex_j = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_loc); + p->__pyx_v_loc = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_locs); + p->__pyx_v_locs = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_max_locs); + p->__pyx_v_max_locs = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_meta); + p->__pyx_v_meta = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_new_frontier); + p->__pyx_v_new_frontier = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_new_node); + p->__pyx_v_new_node = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_next_states); + p->__pyx_v_next_states = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_node); + p->__pyx_v_node = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_nodes_isteps_away_buffer); + p->__pyx_v_nodes_isteps_away_buffer = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_pathlen); + p->__pyx_v_pathlen = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_phrase); + 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_4cdec_2sa_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); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_reachable_buffer); + p->__pyx_v_reachable_buffer = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_sa_range); + 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_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_scores); + p->__pyx_v_scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_seen_phrases); + p->__pyx_v_seen_phrases = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_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); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_stats); + p->__pyx_v_stats = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + 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_suffix_link); + p->__pyx_v_suffix_link = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_suffix_link_xcat_index); + p->__pyx_v_suffix_link_xcat_index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_word_id); + p->__pyx_v_word_id = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_xcat_index); + p->__pyx_v_xcat_index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_xnode); + p->__pyx_v_xnode = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_xroot); + p->__pyx_v_xroot = 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); + 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 PyTypeObject __pyx_type_4cdec_2sa_3_sa_DataArray = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.DataArray"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_DataArray), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_19_input"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_DataArray, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -73349,25 +75719,25 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_DataArray = { #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_DataArray, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_DataArray, /*tp_as_mapping*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa_DataArray, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_DataArray, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_DataArray, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_4cdec_2sa_3_sa_DataArray, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -73375,7 +75745,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_DataArray = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_DataArray, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -73387,33 +75757,77 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_DataArray = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BitSetIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_BitSetIterator(PyObject *o) { - (*Py_TYPE(o)->tp_free)(o); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_word); + Py_CLEAR(p->__pyx_t_0); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_BitSetIterator[] = { - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_14BitSetIterator_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_word) { + e = (*v)(p->__pyx_v_word, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + return 0; +} -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BitSetIterator = { +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_word); + p->__pyx_v_word = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.BitSetIterator"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_20_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_BitSetIterator, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -73432,15 +75846,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BitSetIterator = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ - __pyx_pw_4cdec_2sa_3_sa_14BitSetIterator_1__next__, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_BitSetIterator, /*tp_methods*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -73450,7 +75864,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BitSetIterator = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_BitSetIterator, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -73462,206 +75876,133 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BitSetIterator = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory __pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_HieroCachingRuleFactory(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *p; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)o); - p->__pyx_vtab = __pyx_vtabptr_4cdec_2sa_3_sa_HieroCachingRuleFactory; - p->rules = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)Py_None); Py_INCREF(Py_None); - p->sampler = ((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)Py_None); Py_INCREF(Py_None); - p->scorer = ((struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)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_4cdec_2sa_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); - p->fda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); - p->eda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); - p->alignment = ((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)Py_None); Py_INCREF(Py_None); - p->eid2symid = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->fid2symid = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->findexes = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->findexes1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->online_stats = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_HieroCachingRuleFactory(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->rules); - Py_CLEAR(p->sampler); - Py_CLEAR(p->scorer); - Py_CLEAR(p->precomputed_index); - Py_CLEAR(p->precomputed_collocations); - Py_CLEAR(p->precompute_file); - Py_CLEAR(p->max_rank); - Py_CLEAR(p->prev_norm_prefix); - Py_CLEAR(p->fsa); - Py_CLEAR(p->fda); - Py_CLEAR(p->eda); - Py_CLEAR(p->alignment); - Py_CLEAR(p->eid2symid); - Py_CLEAR(p->fid2symid); - Py_CLEAR(p->findexes); - Py_CLEAR(p->findexes1); - Py_CLEAR(p->online_stats); - (*Py_TYPE(o)->tp_free)(o); + Py_CLEAR(p->__pyx_v_al); + Py_CLEAR(p->__pyx_v_cover); + Py_CLEAR(p->__pyx_v_e_nt_cover); + Py_CLEAR(p->__pyx_v_e_words); + Py_CLEAR(p->__pyx_v_ef_span); + Py_CLEAR(p->__pyx_v_extract); + Py_CLEAR(p->__pyx_v_f_len); + Py_CLEAR(p->__pyx_v_f_words); + Py_CLEAR(p->__pyx_v_fe_span); + Py_CLEAR(p->__pyx_v_rules); + Py_CLEAR(p->__pyx_v_self); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa_HieroCachingRuleFactory(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)o; - if (p->rules) { - e = (*v)(((PyObject*)p->rules), a); if (e) return e; - } - if (p->sampler) { - e = (*v)(((PyObject*)p->sampler), a); if (e) return e; - } - if (p->scorer) { - e = (*v)(((PyObject*)p->scorer), a); if (e) return e; - } - if (p->precomputed_index) { - e = (*v)(p->precomputed_index, a); if (e) return e; - } - if (p->precomputed_collocations) { - e = (*v)(p->precomputed_collocations, a); if (e) return e; - } - if (p->precompute_file) { - e = (*v)(p->precompute_file, a); if (e) return e; - } - if (p->max_rank) { - e = (*v)(p->max_rank, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o; + if (p->__pyx_v_al) { + e = (*v)(p->__pyx_v_al, a); if (e) return e; } - if (p->prev_norm_prefix) { - e = (*v)(p->prev_norm_prefix, a); if (e) return e; + if (p->__pyx_v_cover) { + e = (*v)(p->__pyx_v_cover, a); if (e) return e; } - if (p->fsa) { - e = (*v)(((PyObject*)p->fsa), a); if (e) return e; + if (p->__pyx_v_e_nt_cover) { + e = (*v)(p->__pyx_v_e_nt_cover, a); if (e) return e; } - if (p->fda) { - e = (*v)(((PyObject*)p->fda), a); if (e) return e; + if (p->__pyx_v_e_words) { + e = (*v)(p->__pyx_v_e_words, a); if (e) return e; } - if (p->eda) { - e = (*v)(((PyObject*)p->eda), a); if (e) return e; + if (p->__pyx_v_ef_span) { + e = (*v)(p->__pyx_v_ef_span, a); if (e) return e; } - if (p->alignment) { - e = (*v)(((PyObject*)p->alignment), a); if (e) return e; + if (p->__pyx_v_extract) { + e = (*v)(p->__pyx_v_extract, a); if (e) return e; } - if (p->eid2symid) { - e = (*v)(((PyObject*)p->eid2symid), a); if (e) return e; + if (p->__pyx_v_f_len) { + e = (*v)(p->__pyx_v_f_len, a); if (e) return e; } - if (p->fid2symid) { - e = (*v)(((PyObject*)p->fid2symid), a); if (e) return e; + if (p->__pyx_v_f_words) { + e = (*v)(p->__pyx_v_f_words, a); if (e) return e; } - if (p->findexes) { - e = (*v)(((PyObject*)p->findexes), a); if (e) return e; + if (p->__pyx_v_fe_span) { + e = (*v)(p->__pyx_v_fe_span, a); if (e) return e; } - if (p->findexes1) { - e = (*v)(((PyObject*)p->findexes1), a); if (e) return e; + if (p->__pyx_v_rules) { + e = (*v)(p->__pyx_v_rules, a); if (e) return e; } - if (p->online_stats) { - e = (*v)(p->online_stats, a); if (e) return e; + if (p->__pyx_v_self) { + e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa_HieroCachingRuleFactory(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->rules); - p->rules = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->sampler); - p->sampler = ((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->scorer); - p->scorer = ((struct __pyx_obj_4cdec_2sa_3_sa_Scorer *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->precomputed_index); - p->precomputed_index = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->precomputed_collocations); - p->precomputed_collocations = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->precompute_file); - p->precompute_file = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->max_rank); - p->max_rank = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o; + tmp = ((PyObject*)p->__pyx_v_al); + p->__pyx_v_al = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->prev_norm_prefix); - p->prev_norm_prefix = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_cover); + p->__pyx_v_cover = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->fsa); - p->fsa = ((struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_e_nt_cover); + p->__pyx_v_e_nt_cover = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->fda); - p->fda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_e_words); + p->__pyx_v_e_words = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->eda); - p->eda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_ef_span); + p->__pyx_v_ef_span = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->alignment); - p->alignment = ((struct __pyx_obj_4cdec_2sa_3_sa_Alignment *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_extract); + p->__pyx_v_extract = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->eid2symid); - p->eid2symid = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_f_len); + p->__pyx_v_f_len = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->fid2symid); - p->fid2symid = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_f_words); + p->__pyx_v_f_words = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->findexes); - p->findexes = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_fe_span); + p->__pyx_v_fe_span = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->findexes1); - p->findexes1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_rules); + p->__pyx_v_rules = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->online_stats); - p->online_stats = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_HieroCachingRuleFactory[] = { - {__Pyx_NAMESTR("configure"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure)}, - {__Pyx_NAMESTR("pattern2phrase"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5pattern2phrase, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("pattern2phrase_plus"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("precompute"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9precompute, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_precomputed_collocation"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_11get_precomputed_collocation, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("advance"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_all_nodes_isteps_away"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_away, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("reachable"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("shortest"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_next_states"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_states, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("input"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input)}, - {__Pyx_NAMESTR("add_instance"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instance, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("form_rule"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("fmt_rule"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("online_ctx_lookup"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_f_phrases"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_34get_f_phrases, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("drop_ctx"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.HieroCachingRuleFactory"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_21_add_instance"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_HieroCachingRuleFactory, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -73680,15 +76021,15 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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_4cdec_2sa_3_sa_HieroCachingRuleFactory, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa_HieroCachingRuleFactory, /*tp_clear*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_HieroCachingRuleFactory, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -73698,7 +76039,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_HieroCachingRuleFactory, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -73710,70 +76051,196 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___str__[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___str__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o); - p->__pyx_v_self = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o; PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_links); Py_CLEAR(p->__pyx_v_self); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___str__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o; + if (p->__pyx_v_links) { + e = (*v)(p->__pyx_v_links, a); if (e) return e; + } if (p->__pyx_v_self) { e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyObject *o) { PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o; + tmp = ((PyObject*)p->__pyx_v_links); + p->__pyx_v_links = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_22_form_rule"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*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*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*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_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*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 + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_i); + Py_CLEAR(p->__pyx_v_j); + Py_CLEAR(p->__pyx_t_0); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_i) { + e = (*v)(p->__pyx_v_i, a); if (e) return e; + } + if (p->__pyx_v_j) { + e = (*v)(p->__pyx_v_j, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_i); + p->__pyx_v_i = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_j); + p->__pyx_v_j = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_28___str__[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_28___str__"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_23_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -73794,13 +76261,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -73810,7 +76277,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -73822,110 +76289,70 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *)o); - p->__pyx_v_ngram = 0; - p->__pyx_v_ngram_start = 0; - p->__pyx_v_ngram_starts = 0; - p->__pyx_v_run_start = 0; - p->__pyx_v_self = 0; - p->__pyx_v_veb = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_ngram); - Py_CLEAR(p->__pyx_v_ngram_start); - Py_CLEAR(p->__pyx_v_ngram_starts); - Py_CLEAR(p->__pyx_v_run_start); + Py_CLEAR(p->__pyx_v_a); Py_CLEAR(p->__pyx_v_self); - Py_CLEAR(p->__pyx_v_veb); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *)o); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *)o; - if (p->__pyx_v_ngram) { - e = (*v)(p->__pyx_v_ngram, a); if (e) return e; - } - if (p->__pyx_v_ngram_start) { - e = (*v)(((PyObject*)p->__pyx_v_ngram_start), a); if (e) return e; - } - if (p->__pyx_v_ngram_starts) { - e = (*v)(p->__pyx_v_ngram_starts, a); if (e) return e; - } - if (p->__pyx_v_run_start) { - e = (*v)(((PyObject*)p->__pyx_v_run_start), a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o; + if (p->__pyx_v_a) { + e = (*v)(p->__pyx_v_a, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; } - if (p->__pyx_v_veb) { - e = (*v)(((PyObject*)p->__pyx_v_veb), a); if (e) return e; - } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *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_4cdec_2sa_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_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o; + tmp = ((PyObject*)p->__pyx_v_a); + p->__pyx_v_a = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_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_4cdec_2sa_3_sa_VEB *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_3_compute_stats"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_24_fmt_rule"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -73946,13 +76373,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -73962,7 +76389,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -73974,54 +76401,49 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_sym = 0; - p->__pyx_t_0 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_sym); + Py_CLEAR(p->__pyx_v_packed); Py_CLEAR(p->__pyx_t_0); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *)o); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *)o; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; } - if (p->__pyx_v_sym) { - e = (*v)(p->__pyx_v_sym, a); if (e) return e; + if (p->__pyx_v_packed) { + e = (*v)(p->__pyx_v_packed, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; @@ -74029,14 +76451,14 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyObje return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObject *o) { PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o; tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words *)Py_None); Py_INCREF(Py_None); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_sym); - p->__pyx_v_sym = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_v_packed); + p->__pyx_v_packed = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_t_0); p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); @@ -74044,16 +76466,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyObject return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_14_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_25_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -74074,13 +76492,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -74090,7 +76508,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -74102,70 +76520,84 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct____iter__[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct____iter__ = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct____iter__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct____iter__]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *)o); - p->__pyx_v_self = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct____iter__(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o; PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_extract); + Py_CLEAR(p->__pyx_v_f_words); + Py_CLEAR(p->__pyx_v_phrases); Py_CLEAR(p->__pyx_v_self); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct____iter__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct____iter__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *)o); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *)o; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o; + if (p->__pyx_v_extract) { + e = (*v)(p->__pyx_v_extract, a); if (e) return e; + } + if (p->__pyx_v_f_words) { + e = (*v)(p->__pyx_v_f_words, a); if (e) return e; + } + if (p->__pyx_v_phrases) { + e = (*v)(p->__pyx_v_phrases, a); if (e) return e; + } if (p->__pyx_v_self) { e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct____iter__(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o) { PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o; + tmp = ((PyObject*)p->__pyx_v_extract); + p->__pyx_v_extract = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_f_words); + p->__pyx_v_f_words = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_phrases); + p->__pyx_v_phrases = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct____iter__[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct____iter__ = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct____iter__"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_26_get_f_phrases"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct____iter__, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -74186,13 +76618,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct____iter__ = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct____iter__, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct____iter__, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct____iter__, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -74202,7 +76634,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct____iter__ = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct____iter__, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -74214,134 +76646,63 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct____iter__ = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *)o); - p->__pyx_outer_scope = 0; - p->__pyx_v_arc = 0; - p->__pyx_v_dist = 0; - p->__pyx_v_node = 0; - p->__pyx_v_sym = 0; - p->__pyx_v_weight = 0; - p->__pyx_t_0 = 0; - p->__pyx_t_3 = 0; - p->__pyx_t_4 = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_arc); - Py_CLEAR(p->__pyx_v_dist); - Py_CLEAR(p->__pyx_v_node); - Py_CLEAR(p->__pyx_v_sym); - Py_CLEAR(p->__pyx_v_weight); - Py_CLEAR(p->__pyx_t_0); - Py_CLEAR(p->__pyx_t_3); - Py_CLEAR(p->__pyx_t_4); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *)o); + Py_CLEAR(p->__pyx_v_self); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_arc) { - e = (*v)(p->__pyx_v_arc, a); if (e) return e; - } - if (p->__pyx_v_dist) { - e = (*v)(p->__pyx_v_dist, a); if (e) return e; - } - if (p->__pyx_v_node) { - e = (*v)(p->__pyx_v_node, a); if (e) return e; - } - if (p->__pyx_v_sym) { - e = (*v)(p->__pyx_v_sym, a); if (e) return e; - } - if (p->__pyx_v_weight) { - e = (*v)(p->__pyx_v_weight, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, 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_4) { - e = (*v)(p->__pyx_t_4, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___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_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_arc); - p->__pyx_v_arc = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_dist); - p->__pyx_v_dist = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_node); - p->__pyx_v_node = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_sym); - p->__pyx_v_sym = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_weight); - p->__pyx_v_weight = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = 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); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_4); - p->__pyx_t_4 = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o; + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_8_genexpr"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_27___iter__"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -74362,13 +76723,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -74378,7 +76739,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -74390,67 +76751,63 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_BitSet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___str__[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = 0; + +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - if (unlikely(__pyx_pw_4cdec_2sa_3_sa_6BitSet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { - Py_DECREF(o); o = 0; + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___str__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa_BitSet(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_4cdec_2sa_3_sa_6BitSet_3__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_self); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___str__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); } - (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_BitSet[] = { - {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6BitSet_7insert, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("findsucc"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6BitSet_9findsucc, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("min"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6BitSet_13min, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("max"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6BitSet_15max, METH_NOARGS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static PySequenceMethods __pyx_tp_as_sequence_BitSet = { - __pyx_pw_4cdec_2sa_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_4cdec_2sa_3_sa_6BitSet_19__contains__, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o; + if (p->__pyx_v_self) { + e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + } + return 0; +} -static PyMappingMethods __pyx_tp_as_mapping_BitSet = { - __pyx_pw_4cdec_2sa_3_sa_6BitSet_17__len__, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o; + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} -static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BitSet = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.BitSet"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa_BitSet), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_28___str__"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa_BitSet, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -74461,23 +76818,23 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BitSet = { #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_BitSet, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_BitSet, /*tp_as_mapping*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ - __pyx_pw_4cdec_2sa_3_sa_6BitSet_11__str__, /*tp_str*/ + 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pw_4cdec_2sa_3_sa_6BitSet_5__iter__, /*tp_iter*/ + 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa_BitSet, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -74487,7 +76844,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BitSet = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa_BitSet, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -74499,70 +76856,77 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa_BitSet = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; -static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence[8]; -static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence = 0; +static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr[8]; +static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = 0; -static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *p; +static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence)))) { - o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence]; - memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence)); - PyObject_INIT(o, t); + if (likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr)))) { + o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr)); + (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } - p = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)o); - p->__pyx_v_lattice = 0; return o; } -static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)o; +static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObject *o) { + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o; PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_lattice); - if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence))) { - __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_feat); + Py_CLEAR(p->__pyx_t_0); + if ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr))) { + __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } -static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)o; - if (p->__pyx_v_lattice) { - e = (*v)(p->__pyx_v_lattice, a); if (e) return e; + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_feat) { + e = (*v)(p->__pyx_v_feat, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence(PyObject *o) { - struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence *)o; +static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObject *o) { PyObject* tmp; - tmp = ((PyObject*)p->__pyx_v_lattice); - p->__pyx_v_lattice = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_feat); + p->__pyx_v_feat = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence = { +static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_9_decode_sentence"), /*tp_name*/ - sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence), /*tp_basicsize*/ + __Pyx_NAMESTR("cdec.sa._sa.__pyx_scope_struct_29_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence, /*tp_dealloc*/ + __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -74583,13 +76947,13 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_senten 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence, /*tp_traverse*/ - __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence, /*tp_clear*/ + __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_traverse*/ + __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -74599,7 +76963,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_senten 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence, /*tp_new*/ + __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -74611,7 +76975,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_senten #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) + #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; @@ -74639,378 +77003,382 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0}, + {&__pyx_kp_s_0_1, __pyx_k_0_1, sizeof(__pyx_k_0_1), 0, 0, 1, 0}, {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, - {&__pyx_n_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 1}, - {&__pyx_n_s_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 1, 1}, - {&__pyx_kp_s_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 1, 0}, - {&__pyx_kp_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 0}, - {&__pyx_n_s_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 1, 1}, - {&__pyx_n_s_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 0, 1, 1}, - {&__pyx_kp_s_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 1, 0}, - {&__pyx_kp_s_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 1, 0}, - {&__pyx_kp_s_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 0, 1, 0}, - {&__pyx_kp_s_114, __pyx_k_114, sizeof(__pyx_k_114), 0, 0, 1, 0}, - {&__pyx_kp_s_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 0, 1, 0}, - {&__pyx_kp_s_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 0, 1, 0}, - {&__pyx_kp_s_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 0, 1, 0}, - {&__pyx_kp_s_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 0, 1, 0}, - {&__pyx_kp_s_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 1, 0}, - {&__pyx_kp_s_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 0, 1, 0}, - {&__pyx_kp_s_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 0, 1, 0}, - {&__pyx_kp_s_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 1, 0}, - {&__pyx_n_s_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 1, 1}, - {&__pyx_kp_s_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 1, 0}, - {&__pyx_n_s_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 0, 1, 1}, - {&__pyx_kp_s_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 1, 0}, - {&__pyx_n_s_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 0, 1, 1}, - {&__pyx_n_s_129, __pyx_k_129, sizeof(__pyx_k_129), 0, 0, 1, 1}, - {&__pyx_kp_s_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 0, 1, 0}, - {&__pyx_kp_s_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 0, 1, 0}, - {&__pyx_kp_s_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 0, 1, 0}, - {&__pyx_kp_s_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 0, 1, 0}, - {&__pyx_kp_s_134, __pyx_k_134, sizeof(__pyx_k_134), 0, 0, 1, 0}, - {&__pyx_kp_s_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 1, 0}, - {&__pyx_kp_s_136, __pyx_k_136, sizeof(__pyx_k_136), 0, 0, 1, 0}, - {&__pyx_kp_s_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 0}, - {&__pyx_kp_s_138, __pyx_k_138, sizeof(__pyx_k_138), 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_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 1, 0}, - {&__pyx_kp_s_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 0, 1, 0}, - {&__pyx_n_s_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 1, 1}, - {&__pyx_n_s_147, __pyx_k_147, sizeof(__pyx_k_147), 0, 0, 1, 1}, - {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, - {&__pyx_kp_s_150, __pyx_k_150, sizeof(__pyx_k_150), 0, 0, 1, 0}, - {&__pyx_kp_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 0}, - {&__pyx_n_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 1}, - {&__pyx_n_s_155, __pyx_k_155, sizeof(__pyx_k_155), 0, 0, 1, 1}, - {&__pyx_kp_s_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 1, 0}, - {&__pyx_kp_s_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 0, 1, 0}, - {&__pyx_kp_s_161, __pyx_k_161, sizeof(__pyx_k_161), 0, 0, 1, 0}, - {&__pyx_kp_s_165, __pyx_k_165, sizeof(__pyx_k_165), 0, 0, 1, 0}, - {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0}, - {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0}, - {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0}, - {&__pyx_n_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 1}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0}, - {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0}, - {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0}, - {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0}, - {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0}, - {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0}, - {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0}, - {&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0}, - {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, - {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0}, - {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 0}, - {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0}, - {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0}, - {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0}, - {&__pyx_kp_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 0}, - {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0}, - {&__pyx_kp_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 0}, - {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_kp_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 0}, - {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0}, - {&__pyx_n_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 1}, - {&__pyx_n_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 1}, - {&__pyx_kp_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 0}, - {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0}, - {&__pyx_kp_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 0}, - {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, - {&__pyx_kp_s_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 1, 0}, - {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0}, - {&__pyx_kp_s_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 1, 0}, - {&__pyx_kp_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 0}, - {&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0}, - {&__pyx_kp_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 0}, - {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, - {&__pyx_kp_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 0}, - {&__pyx_kp_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 0}, - {&__pyx_kp_s_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 0, 1, 0}, - {&__pyx_kp_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 0}, - {&__pyx_kp_s_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 1, 0}, - {&__pyx_kp_s_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 1, 0}, - {&__pyx_kp_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 0}, - {&__pyx_kp_s__0, __pyx_k__0, sizeof(__pyx_k__0), 0, 0, 1, 0}, - {&__pyx_kp_s__1, __pyx_k__1, sizeof(__pyx_k__1), 0, 0, 1, 0}, - {&__pyx_n_s__Counter, __pyx_k__Counter, sizeof(__pyx_k__Counter), 0, 0, 1, 1}, - {&__pyx_n_s__END_OF_FILE, __pyx_k__END_OF_FILE, sizeof(__pyx_k__END_OF_FILE), 0, 0, 1, 1}, - {&__pyx_n_s__END_OF_LINE, __pyx_k__END_OF_LINE, sizeof(__pyx_k__END_OF_LINE), 0, 0, 1, 1}, - {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1}, - {&__pyx_n_s__FeatureContext, __pyx_k__FeatureContext, sizeof(__pyx_k__FeatureContext), 0, 0, 1, 1}, - {&__pyx_n_s__GzipFile, __pyx_k__GzipFile, sizeof(__pyx_k__GzipFile), 0, 0, 1, 1}, - {&__pyx_n_s__INCREMENT, __pyx_k__INCREMENT, sizeof(__pyx_k__INCREMENT), 0, 0, 1, 1}, - {&__pyx_n_s__INITIAL_CAPACITY, __pyx_k__INITIAL_CAPACITY, sizeof(__pyx_k__INITIAL_CAPACITY), 0, 0, 1, 1}, - {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1}, - {&__pyx_n_s__NULL, __pyx_k__NULL, sizeof(__pyx_k__NULL), 0, 0, 1, 1}, - {&__pyx_n_s__RUSAGE_SELF, __pyx_k__RUSAGE_SELF, sizeof(__pyx_k__RUSAGE_SELF), 0, 0, 1, 1}, - {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____enter__, __pyx_k____enter__, sizeof(__pyx_k____enter__), 0, 0, 1, 1}, - {&__pyx_n_s____exit__, __pyx_k____exit__, sizeof(__pyx_k____exit__), 0, 0, 1, 1}, - {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1}, - {&__pyx_n_s____pyx_vtable__, __pyx_k____pyx_vtable__, sizeof(__pyx_k____pyx_vtable__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 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__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1}, - {&__pyx_n_s__advance, __pyx_k__advance, sizeof(__pyx_k__advance), 0, 0, 1, 1}, - {&__pyx_n_s__al, __pyx_k__al, sizeof(__pyx_k__al), 0, 0, 1, 1}, - {&__pyx_n_s__alignment, __pyx_k__alignment, sizeof(__pyx_k__alignment), 0, 0, 1, 1}, - {&__pyx_n_s__alignments, __pyx_k__alignments, sizeof(__pyx_k__alignments), 0, 0, 1, 1}, - {&__pyx_n_s__alphabet_size, __pyx_k__alphabet_size, sizeof(__pyx_k__alphabet_size), 0, 0, 1, 1}, - {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, - {&__pyx_n_s__args, __pyx_k__args, sizeof(__pyx_k__args), 0, 0, 1, 1}, - {&__pyx_n_s__arity, __pyx_k__arity, sizeof(__pyx_k__arity), 0, 0, 1, 1}, - {&__pyx_n_s__arr, __pyx_k__arr, sizeof(__pyx_k__arr), 0, 0, 1, 1}, - {&__pyx_n_s__arr_high, __pyx_k__arr_high, sizeof(__pyx_k__arr_high), 0, 0, 1, 1}, - {&__pyx_n_s__arr_low, __pyx_k__arr_low, sizeof(__pyx_k__arr_low), 0, 0, 1, 1}, - {&__pyx_n_s__by_slack_factor, __pyx_k__by_slack_factor, sizeof(__pyx_k__by_slack_factor), 0, 0, 1, 1}, - {&__pyx_n_s__category, __pyx_k__category, sizeof(__pyx_k__category), 0, 0, 1, 1}, - {&__pyx_n_s__chain, __pyx_k__chain, sizeof(__pyx_k__chain), 0, 0, 1, 1}, - {&__pyx_n_s__children, __pyx_k__children, sizeof(__pyx_k__children), 0, 0, 1, 1}, - {&__pyx_n_s__close, __pyx_k__close, sizeof(__pyx_k__close), 0, 0, 1, 1}, - {&__pyx_n_s__cmp, __pyx_k__cmp, sizeof(__pyx_k__cmp), 0, 0, 1, 1}, - {&__pyx_n_s__col, __pyx_k__col, sizeof(__pyx_k__col), 0, 0, 1, 1}, - {&__pyx_n_s__collect, __pyx_k__collect, sizeof(__pyx_k__collect), 0, 0, 1, 1}, - {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1}, - {&__pyx_n_s__ctx_name, __pyx_k__ctx_name, sizeof(__pyx_k__ctx_name), 0, 0, 1, 1}, - {&__pyx_n_s__curr_idx, __pyx_k__curr_idx, sizeof(__pyx_k__curr_idx), 0, 0, 1, 1}, - {&__pyx_n_s__debug, __pyx_k__debug, sizeof(__pyx_k__debug), 0, 0, 1, 1}, - {&__pyx_n_s__decode_lattice, __pyx_k__decode_lattice, sizeof(__pyx_k__decode_lattice), 0, 0, 1, 1}, - {&__pyx_n_s__decode_sentence, __pyx_k__decode_sentence, sizeof(__pyx_k__decode_sentence), 0, 0, 1, 1}, - {&__pyx_n_s__decode_words, __pyx_k__decode_words, sizeof(__pyx_k__decode_words), 0, 0, 1, 1}, - {&__pyx_n_s__defaultdict, __pyx_k__defaultdict, sizeof(__pyx_k__defaultdict), 0, 0, 1, 1}, - {&__pyx_n_s__dist, __pyx_k__dist, sizeof(__pyx_k__dist), 0, 0, 1, 1}, - {&__pyx_n_s__e, __pyx_k__e, sizeof(__pyx_k__e), 0, 0, 1, 1}, - {&__pyx_n_s__e_i, __pyx_k__e_i, sizeof(__pyx_k__e_i), 0, 0, 1, 1}, - {&__pyx_n_s__e_j, __pyx_k__e_j, sizeof(__pyx_k__e_j), 0, 0, 1, 1}, - {&__pyx_n_s__e_span, __pyx_k__e_span, sizeof(__pyx_k__e_span), 0, 0, 1, 1}, - {&__pyx_n_s__e_text, __pyx_k__e_text, sizeof(__pyx_k__e_text), 0, 0, 1, 1}, - {&__pyx_n_s__e_words, __pyx_k__e_words, sizeof(__pyx_k__e_words), 0, 0, 1, 1}, - {&__pyx_n_s__earray, __pyx_k__earray, sizeof(__pyx_k__earray), 0, 0, 1, 1}, - {&__pyx_n_s__edarray, __pyx_k__edarray, sizeof(__pyx_k__edarray), 0, 0, 1, 1}, - {&__pyx_n_s__encode_words, __pyx_k__encode_words, sizeof(__pyx_k__encode_words), 0, 0, 1, 1}, - {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1}, - {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1}, - {&__pyx_n_s__ephrase, __pyx_k__ephrase, sizeof(__pyx_k__ephrase), 0, 0, 1, 1}, - {&__pyx_n_s__eword, __pyx_k__eword, sizeof(__pyx_k__eword), 0, 0, 1, 1}, - {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1}, - {&__pyx_n_s__extended, __pyx_k__extended, sizeof(__pyx_k__extended), 0, 0, 1, 1}, - {&__pyx_n_s__extract, __pyx_k__extract, sizeof(__pyx_k__extract), 0, 0, 1, 1}, - {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1}, - {&__pyx_n_s__f_i, __pyx_k__f_i, sizeof(__pyx_k__f_i), 0, 0, 1, 1}, - {&__pyx_n_s__f_j, __pyx_k__f_j, sizeof(__pyx_k__f_j), 0, 0, 1, 1}, - {&__pyx_n_s__f_span, __pyx_k__f_span, sizeof(__pyx_k__f_span), 0, 0, 1, 1}, - {&__pyx_n_s__f_text, __pyx_k__f_text, sizeof(__pyx_k__f_text), 0, 0, 1, 1}, - {&__pyx_n_s__f_words, __pyx_k__f_words, sizeof(__pyx_k__f_words), 0, 0, 1, 1}, - {&__pyx_n_s__fcount, __pyx_k__fcount, sizeof(__pyx_k__fcount), 0, 0, 1, 1}, - {&__pyx_n_s__filename, __pyx_k__filename, sizeof(__pyx_k__filename), 0, 0, 1, 1}, - {&__pyx_n_s__form_rule, __pyx_k__form_rule, sizeof(__pyx_k__form_rule), 0, 0, 1, 1}, - {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1}, - {&__pyx_n_s__fphrase, __pyx_k__fphrase, sizeof(__pyx_k__fphrase), 0, 0, 1, 1}, - {&__pyx_n_s__from_binary, __pyx_k__from_binary, sizeof(__pyx_k__from_binary), 0, 0, 1, 1}, - {&__pyx_n_s__from_data, __pyx_k__from_data, sizeof(__pyx_k__from_data), 0, 0, 1, 1}, - {&__pyx_n_s__from_iterable, __pyx_k__from_iterable, sizeof(__pyx_k__from_iterable), 0, 0, 1, 1}, - {&__pyx_n_s__from_stats, __pyx_k__from_stats, sizeof(__pyx_k__from_stats), 0, 0, 1, 1}, - {&__pyx_n_s__from_text, __pyx_k__from_text, sizeof(__pyx_k__from_text), 0, 0, 1, 1}, - {&__pyx_n_s__frontier, __pyx_k__frontier, sizeof(__pyx_k__frontier), 0, 0, 1, 1}, - {&__pyx_n_s__fsample_count, __pyx_k__fsample_count, sizeof(__pyx_k__fsample_count), 0, 0, 1, 1}, - {&__pyx_n_s__fsarray, __pyx_k__fsarray, sizeof(__pyx_k__fsarray), 0, 0, 1, 1}, - {&__pyx_n_s__fword, __pyx_k__fword, sizeof(__pyx_k__fword), 0, 0, 1, 1}, - {&__pyx_n_s__fwords, __pyx_k__fwords, sizeof(__pyx_k__fwords), 0, 0, 1, 1}, - {&__pyx_n_s__gc, __pyx_k__gc, sizeof(__pyx_k__gc), 0, 0, 1, 1}, - {&__pyx_n_s__genexpr, __pyx_k__genexpr, sizeof(__pyx_k__genexpr), 0, 0, 1, 1}, - {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1}, - {&__pyx_n_s__getLogger, __pyx_k__getLogger, sizeof(__pyx_k__getLogger), 0, 0, 1, 1}, - {&__pyx_n_s__get_e_id, __pyx_k__get_e_id, sizeof(__pyx_k__get_e_id), 0, 0, 1, 1}, - {&__pyx_n_s__get_f_id, __pyx_k__get_f_id, sizeof(__pyx_k__get_f_id), 0, 0, 1, 1}, - {&__pyx_n_s__get_f_phrases, __pyx_k__get_f_phrases, sizeof(__pyx_k__get_f_phrases), 0, 0, 1, 1}, - {&__pyx_n_s__get_id, __pyx_k__get_id, sizeof(__pyx_k__get_id), 0, 0, 1, 1}, - {&__pyx_n_s__get_next_states, __pyx_k__get_next_states, sizeof(__pyx_k__get_next_states), 0, 0, 1, 1}, - {&__pyx_n_s__get_word, __pyx_k__get_word, sizeof(__pyx_k__get_word), 0, 0, 1, 1}, - {&__pyx_n_s__getchunk, __pyx_k__getchunk, sizeof(__pyx_k__getchunk), 0, 0, 1, 1}, - {&__pyx_n_s__getrusage, __pyx_k__getrusage, sizeof(__pyx_k__getrusage), 0, 0, 1, 1}, - {&__pyx_n_s__gzip, __pyx_k__gzip, sizeof(__pyx_k__gzip), 0, 0, 1, 1}, - {&__pyx_n_s__gzip_or_text, __pyx_k__gzip_or_text, sizeof(__pyx_k__gzip_or_text), 0, 0, 1, 1}, - {&__pyx_n_s__h, __pyx_k__h, sizeof(__pyx_k__h), 0, 0, 1, 1}, - {&__pyx_n_s__high, __pyx_k__high, sizeof(__pyx_k__high), 0, 0, 1, 1}, - {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1}, - {&__pyx_n_s__ifrom, __pyx_k__ifrom, sizeof(__pyx_k__ifrom), 0, 0, 1, 1}, - {&__pyx_n_s__increment, __pyx_k__increment, sizeof(__pyx_k__increment), 0, 0, 1, 1}, - {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1}, - {&__pyx_n_s__info, __pyx_k__info, sizeof(__pyx_k__info), 0, 0, 1, 1}, - {&__pyx_n_s__initial_len, __pyx_k__initial_len, sizeof(__pyx_k__initial_len), 0, 0, 1, 1}, - {&__pyx_n_s__input_match, __pyx_k__input_match, sizeof(__pyx_k__input_match), 0, 0, 1, 1}, - {&__pyx_n_s__input_span, __pyx_k__input_span, sizeof(__pyx_k__input_span), 0, 0, 1, 1}, - {&__pyx_n_s__insert, __pyx_k__insert, sizeof(__pyx_k__insert), 0, 0, 1, 1}, - {&__pyx_n_s__isa, __pyx_k__isa, sizeof(__pyx_k__isa), 0, 0, 1, 1}, - {&__pyx_n_s__isvar, __pyx_k__isvar, sizeof(__pyx_k__isvar), 0, 0, 1, 1}, - {&__pyx_n_s__iteritems, __pyx_k__iteritems, sizeof(__pyx_k__iteritems), 0, 0, 1, 1}, - {&__pyx_n_s__itertools, __pyx_k__itertools, sizeof(__pyx_k__itertools), 0, 0, 1, 1}, - {&__pyx_n_s__itervalues, __pyx_k__itervalues, sizeof(__pyx_k__itervalues), 0, 0, 1, 1}, - {&__pyx_n_s__ito, __pyx_k__ito, sizeof(__pyx_k__ito), 0, 0, 1, 1}, - {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1}, - {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1}, - {&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1}, - {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1}, - {&__pyx_n_s__lattice, __pyx_k__lattice, sizeof(__pyx_k__lattice), 0, 0, 1, 1}, - {&__pyx_n_s__lex_i, __pyx_k__lex_i, sizeof(__pyx_k__lex_i), 0, 0, 1, 1}, - {&__pyx_n_s__lex_j, __pyx_k__lex_j, sizeof(__pyx_k__lex_j), 0, 0, 1, 1}, - {&__pyx_n_s__lhs, __pyx_k__lhs, sizeof(__pyx_k__lhs), 0, 0, 1, 1}, - {&__pyx_n_s__link, __pyx_k__link, sizeof(__pyx_k__link), 0, 0, 1, 1}, - {&__pyx_n_s__link_i, __pyx_k__link_i, sizeof(__pyx_k__link_i), 0, 0, 1, 1}, - {&__pyx_n_s__link_j, __pyx_k__link_j, sizeof(__pyx_k__link_j), 0, 0, 1, 1}, - {&__pyx_n_s__links, __pyx_k__links, sizeof(__pyx_k__links), 0, 0, 1, 1}, - {&__pyx_n_s__logger, __pyx_k__logger, sizeof(__pyx_k__logger), 0, 0, 1, 1}, - {&__pyx_n_s__logging, __pyx_k__logging, sizeof(__pyx_k__logging), 0, 0, 1, 1}, - {&__pyx_n_s__lookup, __pyx_k__lookup, sizeof(__pyx_k__lookup), 0, 0, 1, 1}, - {&__pyx_n_s__low, __pyx_k__low, sizeof(__pyx_k__low), 0, 0, 1, 1}, - {&__pyx_n_s__make_lattice, __pyx_k__make_lattice, sizeof(__pyx_k__make_lattice), 0, 0, 1, 1}, - {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1}, - {&__pyx_n_s__matches, __pyx_k__matches, sizeof(__pyx_k__matches), 0, 0, 1, 1}, - {&__pyx_n_s__max, __pyx_k__max, sizeof(__pyx_k__max), 0, 0, 1, 1}, - {&__pyx_n_s__max_chunks, __pyx_k__max_chunks, sizeof(__pyx_k__max_chunks), 0, 0, 1, 1}, - {&__pyx_n_s__max_initial_size, __pyx_k__max_initial_size, sizeof(__pyx_k__max_initial_size), 0, 0, 1, 1}, - {&__pyx_n_s__max_length, __pyx_k__max_length, sizeof(__pyx_k__max_length), 0, 0, 1, 1}, - {&__pyx_n_s__max_nonterminals, __pyx_k__max_nonterminals, sizeof(__pyx_k__max_nonterminals), 0, 0, 1, 1}, - {&__pyx_n_s__max_target_chunks, __pyx_k__max_target_chunks, sizeof(__pyx_k__max_target_chunks), 0, 0, 1, 1}, - {&__pyx_n_s__max_target_length, __pyx_k__max_target_length, sizeof(__pyx_k__max_target_length), 0, 0, 1, 1}, - {&__pyx_n_s__merge, __pyx_k__merge, sizeof(__pyx_k__merge), 0, 0, 1, 1}, - {&__pyx_n_s__meta, __pyx_k__meta, sizeof(__pyx_k__meta), 0, 0, 1, 1}, - {&__pyx_n_s__min_bound, __pyx_k__min_bound, sizeof(__pyx_k__min_bound), 0, 0, 1, 1}, - {&__pyx_n_s__min_dist, __pyx_k__min_dist, sizeof(__pyx_k__min_dist), 0, 0, 1, 1}, - {&__pyx_n_s__min_gap_size, __pyx_k__min_gap_size, sizeof(__pyx_k__min_gap_size), 0, 0, 1, 1}, - {&__pyx_n_s__monitor_cpu, __pyx_k__monitor_cpu, sizeof(__pyx_k__monitor_cpu), 0, 0, 1, 1}, - {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1}, - {&__pyx_n_s__namedtuple, __pyx_k__namedtuple, sizeof(__pyx_k__namedtuple), 0, 0, 1, 1}, - {&__pyx_n_s__new_e_i, __pyx_k__new_e_i, sizeof(__pyx_k__new_e_i), 0, 0, 1, 1}, - {&__pyx_n_s__new_e_j, __pyx_k__new_e_j, sizeof(__pyx_k__new_e_j), 0, 0, 1, 1}, - {&__pyx_n_s__new_lex_i, __pyx_k__new_lex_i, sizeof(__pyx_k__new_lex_i), 0, 0, 1, 1}, - {&__pyx_n_s__new_lex_j, __pyx_k__new_lex_j, sizeof(__pyx_k__new_lex_j), 0, 0, 1, 1}, - {&__pyx_n_s__new_min_bound, __pyx_k__new_min_bound, sizeof(__pyx_k__new_min_bound), 0, 0, 1, 1}, - {&__pyx_n_s__next_states, __pyx_k__next_states, sizeof(__pyx_k__next_states), 0, 0, 1, 1}, - {&__pyx_n_s__nt, __pyx_k__nt, sizeof(__pyx_k__nt), 0, 0, 1, 1}, - {&__pyx_n_s__nt_collision, __pyx_k__nt_collision, sizeof(__pyx_k__nt_collision), 0, 0, 1, 1}, - {&__pyx_n_s__nt_open, __pyx_k__nt_open, sizeof(__pyx_k__nt_open), 0, 0, 1, 1}, - {&__pyx_n_s__ntc, __pyx_k__ntc, sizeof(__pyx_k__ntc), 0, 0, 1, 1}, - {&__pyx_n_s__num_subpatterns, __pyx_k__num_subpatterns, sizeof(__pyx_k__num_subpatterns), 0, 0, 1, 1}, - {&__pyx_n_s__offset, __pyx_k__offset, sizeof(__pyx_k__offset), 0, 0, 1, 1}, - {&__pyx_n_s__old_last_nt, __pyx_k__old_last_nt, sizeof(__pyx_k__old_last_nt), 0, 0, 1, 1}, - {&__pyx_n_s__online, __pyx_k__online, sizeof(__pyx_k__online), 0, 0, 1, 1}, - {&__pyx_n_s__online_ctx_lookup, __pyx_k__online_ctx_lookup, sizeof(__pyx_k__online_ctx_lookup), 0, 0, 1, 1}, - {&__pyx_n_s__open, __pyx_k__open, sizeof(__pyx_k__open), 0, 0, 1, 1}, - {&__pyx_n_s__pad, __pyx_k__pad, sizeof(__pyx_k__pad), 0, 0, 1, 1}, - {&__pyx_n_s__paircount, __pyx_k__paircount, sizeof(__pyx_k__paircount), 0, 0, 1, 1}, - {&__pyx_n_s__partition, __pyx_k__partition, sizeof(__pyx_k__partition), 0, 0, 1, 1}, - {&__pyx_n_s__pathlen, __pyx_k__pathlen, sizeof(__pyx_k__pathlen), 0, 0, 1, 1}, - {&__pyx_n_s__pattern2phrase, __pyx_k__pattern2phrase, sizeof(__pyx_k__pattern2phrase), 0, 0, 1, 1}, - {&__pyx_n_s__pattern2phrase_plus, __pyx_k__pattern2phrase_plus, sizeof(__pyx_k__pattern2phrase_plus), 0, 0, 1, 1}, - {&__pyx_n_s__phrase, __pyx_k__phrase, sizeof(__pyx_k__phrase), 0, 0, 1, 1}, - {&__pyx_n_s__phrase_location, __pyx_k__phrase_location, sizeof(__pyx_k__phrase_location), 0, 0, 1, 1}, - {&__pyx_n_s__phrases_al, __pyx_k__phrases_al, sizeof(__pyx_k__phrases_al), 0, 0, 1, 1}, - {&__pyx_n_s__phrases_e, __pyx_k__phrases_e, sizeof(__pyx_k__phrases_e), 0, 0, 1, 1}, - {&__pyx_n_s__phrases_f, __pyx_k__phrases_f, sizeof(__pyx_k__phrases_f), 0, 0, 1, 1}, - {&__pyx_n_s__phrases_fe, __pyx_k__phrases_fe, sizeof(__pyx_k__phrases_fe), 0, 0, 1, 1}, - {&__pyx_n_s__plus_links, __pyx_k__plus_links, sizeof(__pyx_k__plus_links), 0, 0, 1, 1}, - {&__pyx_n_s__pop, __pyx_k__pop, sizeof(__pyx_k__pop), 0, 0, 1, 1}, - {&__pyx_n_s__precompute, __pyx_k__precompute, sizeof(__pyx_k__precompute), 0, 0, 1, 1}, - {&__pyx_n_s__precompute_file, __pyx_k__precompute_file, sizeof(__pyx_k__precompute_file), 0, 0, 1, 1}, - {&__pyx_n_s__precompute_rank, __pyx_k__precompute_rank, sizeof(__pyx_k__precompute_rank), 0, 0, 1, 1}, - {&__pyx_n_s__precomputed, __pyx_k__precomputed, sizeof(__pyx_k__precomputed), 0, 0, 1, 1}, - {&__pyx_n_s__q3sort, __pyx_k__q3sort, sizeof(__pyx_k__q3sort), 0, 0, 1, 1}, - {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1}, - {&__pyx_n_s__reachable, __pyx_k__reachable, sizeof(__pyx_k__reachable), 0, 0, 1, 1}, - {&__pyx_n_s__reachable_buffer, __pyx_k__reachable_buffer, sizeof(__pyx_k__reachable_buffer), 0, 0, 1, 1}, - {&__pyx_n_s__read_binary, __pyx_k__read_binary, sizeof(__pyx_k__read_binary), 0, 0, 1, 1}, - {&__pyx_n_s__read_bitext, __pyx_k__read_bitext, sizeof(__pyx_k__read_bitext), 0, 0, 1, 1}, - {&__pyx_n_s__read_text, __pyx_k__read_text, sizeof(__pyx_k__read_text), 0, 0, 1, 1}, - {&__pyx_n_s__read_text_data, __pyx_k__read_text_data, sizeof(__pyx_k__read_text_data), 0, 0, 1, 1}, - {&__pyx_n_s__res, __pyx_k__res, sizeof(__pyx_k__res), 0, 0, 1, 1}, - {&__pyx_n_s__reset, __pyx_k__reset, sizeof(__pyx_k__reset), 0, 0, 1, 1}, - {&__pyx_n_s__resource, __pyx_k__resource, sizeof(__pyx_k__resource), 0, 0, 1, 1}, - {&__pyx_n_s__ru_stime, __pyx_k__ru_stime, sizeof(__pyx_k__ru_stime), 0, 0, 1, 1}, - {&__pyx_n_s__ru_utime, __pyx_k__ru_utime, sizeof(__pyx_k__ru_utime), 0, 0, 1, 1}, - {&__pyx_n_s__sa, __pyx_k__sa, sizeof(__pyx_k__sa), 0, 0, 1, 1}, - {&__pyx_n_s__sa_high, __pyx_k__sa_high, sizeof(__pyx_k__sa_high), 0, 0, 1, 1}, - {&__pyx_n_s__sa_low, __pyx_k__sa_low, sizeof(__pyx_k__sa_low), 0, 0, 1, 1}, - {&__pyx_n_s__sample, __pyx_k__sample, sizeof(__pyx_k__sample), 0, 0, 1, 1}, - {&__pyx_n_s__sample_size, __pyx_k__sample_size, sizeof(__pyx_k__sample_size), 0, 0, 1, 1}, - {&__pyx_n_s__sampler, __pyx_k__sampler, sizeof(__pyx_k__sampler), 0, 0, 1, 1}, - {&__pyx_n_s__samples_f, __pyx_k__samples_f, sizeof(__pyx_k__samples_f), 0, 0, 1, 1}, - {&__pyx_n_s__sarray, __pyx_k__sarray, sizeof(__pyx_k__sarray), 0, 0, 1, 1}, - {&__pyx_n_s__scorer, __pyx_k__scorer, sizeof(__pyx_k__scorer), 0, 0, 1, 1}, - {&__pyx_n_s__scores, __pyx_k__scores, sizeof(__pyx_k__scores), 0, 0, 1, 1}, - {&__pyx_n_s__seek, __pyx_k__seek, sizeof(__pyx_k__seek), 0, 0, 1, 1}, - {&__pyx_n_s__send, __pyx_k__send, sizeof(__pyx_k__send), 0, 0, 1, 1}, - {&__pyx_n_s__set, __pyx_k__set, sizeof(__pyx_k__set), 0, 0, 1, 1}, - {&__pyx_n_s__shortest, __pyx_k__shortest, sizeof(__pyx_k__shortest), 0, 0, 1, 1}, - {&__pyx_n_s__side, __pyx_k__side, sizeof(__pyx_k__side), 0, 0, 1, 1}, - {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1}, - {&__pyx_n_s__skip, __pyx_k__skip, sizeof(__pyx_k__skip), 0, 0, 1, 1}, - {&__pyx_n_s__sorted, __pyx_k__sorted, sizeof(__pyx_k__sorted), 0, 0, 1, 1}, - {&__pyx_n_s__source, __pyx_k__source, sizeof(__pyx_k__source), 0, 0, 1, 1}, - {&__pyx_n_s__span_check, __pyx_k__span_check, sizeof(__pyx_k__span_check), 0, 0, 1, 1}, - {&__pyx_n_s__span_dec, __pyx_k__span_dec, sizeof(__pyx_k__span_dec), 0, 0, 1, 1}, - {&__pyx_n_s__span_inc, __pyx_k__span_inc, sizeof(__pyx_k__span_inc), 0, 0, 1, 1}, - {&__pyx_n_s__spanlen, __pyx_k__spanlen, sizeof(__pyx_k__spanlen), 0, 0, 1, 1}, - {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1}, - {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1}, - {&__pyx_n_s__stats, __pyx_k__stats, sizeof(__pyx_k__stats), 0, 0, 1, 1}, - {&__pyx_n_s__stop, __pyx_k__stop, sizeof(__pyx_k__stop), 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__syms, __pyx_k__syms, sizeof(__pyx_k__syms), 0, 0, 1, 1}, - {&__pyx_n_s__test_sentence, __pyx_k__test_sentence, sizeof(__pyx_k__test_sentence), 0, 0, 1, 1}, - {&__pyx_n_s__throw, __pyx_k__throw, sizeof(__pyx_k__throw), 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}, - {&__pyx_n_s__train_min_gap_size, __pyx_k__train_min_gap_size, sizeof(__pyx_k__train_min_gap_size), 0, 0, 1, 1}, - {&__pyx_n_s__unlink, __pyx_k__unlink, sizeof(__pyx_k__unlink), 0, 0, 1, 1}, - {&__pyx_n_s__use_baeza_yates, __pyx_k__use_baeza_yates, sizeof(__pyx_k__use_baeza_yates), 0, 0, 1, 1}, - {&__pyx_n_s__use_collocations, __pyx_k__use_collocations, sizeof(__pyx_k__use_collocations), 0, 0, 1, 1}, - {&__pyx_n_s__use_index, __pyx_k__use_index, sizeof(__pyx_k__use_index), 0, 0, 1, 1}, - {&__pyx_n_s__use_sent_id, __pyx_k__use_sent_id, sizeof(__pyx_k__use_sent_id), 0, 0, 1, 1}, - {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1}, - {&__pyx_n_s__vec, __pyx_k__vec, sizeof(__pyx_k__vec), 0, 0, 1, 1}, - {&__pyx_n_s__w, __pyx_k__w, sizeof(__pyx_k__w), 0, 0, 1, 1}, - {&__pyx_n_s__warn, __pyx_k__warn, sizeof(__pyx_k__warn), 0, 0, 1, 1}, - {&__pyx_n_s__wc, __pyx_k__wc, sizeof(__pyx_k__wc), 0, 0, 1, 1}, - {&__pyx_n_s__word, __pyx_k__word, sizeof(__pyx_k__word), 0, 0, 1, 1}, - {&__pyx_n_s__word_alignments, __pyx_k__word_alignments, sizeof(__pyx_k__word_alignments), 0, 0, 1, 1}, - {&__pyx_n_s__word_ids, __pyx_k__word_ids, sizeof(__pyx_k__word_ids), 0, 0, 1, 1}, - {&__pyx_n_s__words, __pyx_k__words, sizeof(__pyx_k__words), 0, 0, 1, 1}, - {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1}, - {&__pyx_n_s__write_text, __pyx_k__write_text, sizeof(__pyx_k__write_text), 0, 0, 1, 1}, - {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1}, - {&__pyx_n_s__y, __pyx_k__y, sizeof(__pyx_k__y), 0, 0, 1, 1}, - {&__pyx_n_s__zip, __pyx_k__zip, sizeof(__pyx_k__zip), 0, 0, 1, 1}, + {&__pyx_kp_s_Bucket_sort_took_f_seconds, __pyx_k_Bucket_sort_took_f_seconds, sizeof(__pyx_k_Bucket_sort_took_f_seconds), 0, 0, 1, 0}, + {&__pyx_kp_s_Computing_collocations, __pyx_k_Computing_collocations, sizeof(__pyx_k_Computing_collocations), 0, 0, 1, 0}, + {&__pyx_kp_s_Computing_inverted_indexes, __pyx_k_Computing_inverted_indexes, sizeof(__pyx_k_Computing_inverted_indexes), 0, 0, 1, 0}, + {&__pyx_kp_s_Constructing_LCP_array, __pyx_k_Constructing_LCP_array, sizeof(__pyx_k_Constructing_LCP_array), 0, 0, 1, 0}, + {&__pyx_kp_s_Converting_d_hash_keys_on_precom, __pyx_k_Converting_d_hash_keys_on_precom, sizeof(__pyx_k_Converting_d_hash_keys_on_precom), 0, 0, 1, 0}, + {&__pyx_kp_s_Converting_d_hash_keys_on_precom_2, __pyx_k_Converting_d_hash_keys_on_precom_2, sizeof(__pyx_k_Converting_d_hash_keys_on_precom_2), 0, 0, 1, 0}, + {&__pyx_n_s_Counter, __pyx_k_Counter, sizeof(__pyx_k_Counter), 0, 0, 1, 1}, + {&__pyx_kp_s_Didn_t_extract_anything_from_d_d, __pyx_k_Didn_t_extract_anything_from_d_d, sizeof(__pyx_k_Didn_t_extract_anything_from_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_END_OF_FILE, __pyx_k_END_OF_FILE, sizeof(__pyx_k_END_OF_FILE), 0, 0, 1, 1}, + {&__pyx_n_s_END_OF_LINE, __pyx_k_END_OF_LINE, sizeof(__pyx_k_END_OF_LINE), 0, 0, 1, 1}, + {&__pyx_kp_s_ERROR_unexpected_pattern_s_in_se, __pyx_k_ERROR_unexpected_pattern_s_in_se, sizeof(__pyx_k_ERROR_unexpected_pattern_s_in_se), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_kp_s_Extract_time_f_seconds, __pyx_k_Extract_time_f_seconds, sizeof(__pyx_k_Extract_time_f_seconds), 0, 0, 1, 0}, + {&__pyx_n_s_FeatureContext, __pyx_k_FeatureContext, sizeof(__pyx_k_FeatureContext), 0, 0, 1, 1}, + {&__pyx_kp_s_Finalizing_sort, __pyx_k_Finalizing_sort, sizeof(__pyx_k_Finalizing_sort), 0, 0, 1, 0}, + {&__pyx_kp_s_Gaps_are_not_tight_phrases, __pyx_k_Gaps_are_not_tight_phrases, sizeof(__pyx_k_Gaps_are_not_tight_phrases), 0, 0, 1, 0}, + {&__pyx_n_s_GzipFile, __pyx_k_GzipFile, sizeof(__pyx_k_GzipFile), 0, 0, 1, 1}, + {&__pyx_n_s_INCREMENT, __pyx_k_INCREMENT, sizeof(__pyx_k_INCREMENT), 0, 0, 1, 1}, + {&__pyx_n_s_INITIAL_CAPACITY, __pyx_k_INITIAL_CAPACITY, sizeof(__pyx_k_INITIAL_CAPACITY), 0, 0, 1, 1}, + {&__pyx_kp_s_Illegal_key_type_s_for_IntList, __pyx_k_Illegal_key_type_s_for_IntList, sizeof(__pyx_k_Illegal_key_type_s_for_IntList), 0, 0, 1, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Inside_edges_of_following_subphr, __pyx_k_Inside_edges_of_following_subphr, sizeof(__pyx_k_Inside_edges_of_following_subphr), 0, 0, 1, 0}, + {&__pyx_kp_s_Inside_edges_of_preceding_subphr, __pyx_k_Inside_edges_of_preceding_subphr, sizeof(__pyx_k_Inside_edges_of_preceding_subphr), 0, 0, 1, 0}, + {&__pyx_kp_s_IntList, __pyx_k_IntList, sizeof(__pyx_k_IntList), 0, 0, 1, 0}, + {&__pyx_kp_s_Intersect_time_f_seconds, __pyx_k_Intersect_time_f_seconds, sizeof(__pyx_k_Intersect_time_f_seconds), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_LHS_symbol_d, __pyx_k_Invalid_LHS_symbol_d, sizeof(__pyx_k_Invalid_LHS_symbol_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Keyword_trie_error, __pyx_k_Keyword_trie_error, sizeof(__pyx_k_Keyword_trie_error), 0, 0, 1, 0}, + {&__pyx_kp_s_LCP_array_completed, __pyx_k_LCP_array_completed, sizeof(__pyx_k_LCP_array_completed), 0, 0, 1, 0}, + {&__pyx_kp_s_Must_specify_an_alignment_object, __pyx_k_Must_specify_an_alignment_object, sizeof(__pyx_k_Must_specify_an_alignment_object), 0, 0, 1, 0}, + {&__pyx_n_s_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 0, 1, 1}, + {&__pyx_kp_s_No_aligned_terminals, __pyx_k_No_aligned_terminals, sizeof(__pyx_k_No_aligned_terminals), 0, 0, 1, 0}, + {&__pyx_kp_s_No_online_bilexical_dictionary_s, __pyx_k_No_online_bilexical_dictionary_s, sizeof(__pyx_k_No_online_bilexical_dictionary_s), 0, 0, 1, 0}, + {&__pyx_n_s_OnlineFeatureContext, __pyx_k_OnlineFeatureContext, sizeof(__pyx_k_OnlineFeatureContext), 0, 0, 1, 1}, + {&__pyx_kp_s_Precomputation_done_with_max_ini, __pyx_k_Precomputation_done_with_max_ini, sizeof(__pyx_k_Precomputation_done_with_max_ini), 0, 0, 1, 0}, + {&__pyx_kp_s_Precomputation_done_with_max_non, __pyx_k_Precomputation_done_with_max_non, sizeof(__pyx_k_Precomputation_done_with_max_non), 0, 0, 1, 0}, + {&__pyx_kp_s_Precomputation_done_with_max_ter, __pyx_k_Precomputation_done_with_max_ter, sizeof(__pyx_k_Precomputation_done_with_max_ter), 0, 0, 1, 0}, + {&__pyx_kp_s_Precomputation_done_with_min_gap, __pyx_k_Precomputation_done_with_min_gap, sizeof(__pyx_k_Precomputation_done_with_min_gap), 0, 0, 1, 0}, + {&__pyx_kp_s_Precomputation_took_f_seconds, __pyx_k_Precomputation_took_f_seconds, sizeof(__pyx_k_Precomputation_took_f_seconds), 0, 0, 1, 0}, + {&__pyx_kp_s_Precomputed_collocations_for_d_p, __pyx_k_Precomputed_collocations_for_d_p, sizeof(__pyx_k_Precomputed_collocations_for_d_p), 0, 0, 1, 0}, + {&__pyx_kp_s_Precomputed_inverted_index_for_d, __pyx_k_Precomputed_inverted_index_for_d, sizeof(__pyx_k_Precomputed_inverted_index_for_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Precomputing_frequent_intersecti, __pyx_k_Precomputing_frequent_intersecti, sizeof(__pyx_k_Precomputing_frequent_intersecti), 0, 0, 1, 0}, + {&__pyx_kp_s_Processing_precomputations_took, __pyx_k_Processing_precomputations_took, sizeof(__pyx_k_Processing_precomputations_took), 0, 0, 1, 0}, + {&__pyx_kp_s_RANK_d_COUNT_COST_d_d_CUMUL_d_d, __pyx_k_RANK_d_COUNT_COST_d_d_CUMUL_d_d, sizeof(__pyx_k_RANK_d_COUNT_COST_d_d_CUMUL_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_RUSAGE_SELF, __pyx_k_RUSAGE_SELF, sizeof(__pyx_k_RUSAGE_SELF), 0, 0, 1, 1}, + {&__pyx_kp_s_Reading_precomputed_data_from_fi, __pyx_k_Reading_precomputed_data_from_fi, sizeof(__pyx_k_Reading_precomputed_data_from_fi), 0, 0, 1, 0}, + {&__pyx_kp_s_Refinement_took_f_seconds, __pyx_k_Refinement_took_f_seconds, sizeof(__pyx_k_Refinement_took_f_seconds), 0, 0, 1, 0}, + {&__pyx_kp_s_Refining_sort_depth_d, __pyx_k_Refining_sort_depth_d, sizeof(__pyx_k_Refining_sort_depth_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Requested_index_d_d_of_d_length, __pyx_k_Requested_index_d_d_of_d_length, sizeof(__pyx_k_Requested_index_d_d_of_d_length), 0, 0, 1, 0}, + {&__pyx_kp_s_Requested_index_d_of_d_length_Fl, __pyx_k_Requested_index_d_of_d_length_Fl, sizeof(__pyx_k_Requested_index_d_of_d_length_Fl), 0, 0, 1, 0}, + {&__pyx_kp_s_Requested_index_d_of_d_length_In, __pyx_k_Requested_index_d_of_d_length_In, sizeof(__pyx_k_Requested_index_d_of_d_length_In), 0, 0, 1, 0}, + {&__pyx_kp_s_Sampling_strategy_no_sampling, __pyx_k_Sampling_strategy_no_sampling, sizeof(__pyx_k_Sampling_strategy_no_sampling), 0, 0, 1, 0}, + {&__pyx_kp_s_Sampling_strategy_uniform_max_sa, __pyx_k_Sampling_strategy_uniform_max_sa, sizeof(__pyx_k_Sampling_strategy_uniform_max_sa), 0, 0, 1, 0}, + {&__pyx_kp_s_Sort_error_in_CLex, __pyx_k_Sort_error_in_CLex, sizeof(__pyx_k_Sort_error_in_CLex), 0, 0, 1, 0}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_kp_s_Subphrase_d_d_failed_integrity_c, __pyx_k_Subphrase_d_d_failed_integrity_c, sizeof(__pyx_k_Subphrase_d_d_failed_integrity_c), 0, 0, 1, 0}, + {&__pyx_kp_s_Suffix_array_construction_took_f, __pyx_k_Suffix_array_construction_took_f, sizeof(__pyx_k_Suffix_array_construction_took_f), 0, 0, 1, 0}, + {&__pyx_kp_s_Total_time_for_rule_lookup_extra, __pyx_k_Total_time_for_rule_lookup_extra, sizeof(__pyx_k_Total_time_for_rule_lookup_extra), 0, 0, 1, 0}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_extract_basic_phrase, __pyx_k_Unable_to_extract_basic_phrase, sizeof(__pyx_k_Unable_to_extract_basic_phrase), 0, 0, 1, 0}, + {&__pyx_kp_s_Unaligned_chunk, __pyx_k_Unaligned_chunk, sizeof(__pyx_k_Unaligned_chunk), 0, 0, 1, 0}, + {&__pyx_kp_s_Unexpected_condition_found_in_q3, __pyx_k_Unexpected_condition_found_in_q3, sizeof(__pyx_k_Unexpected_condition_found_in_q3), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 0}, + {&__pyx_kp_s_X_0_1_2, __pyx_k_X_0_1_2, sizeof(__pyx_k_X_0_1_2), 0, 0, 1, 0}, + {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 0}, + {&__pyx_kp_s__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 1, 0}, + {&__pyx_kp_s__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 0}, + {&__pyx_kp_s__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 0, 1, 0}, + {&__pyx_kp_s__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 0, 1, 0}, + {&__pyx_kp_s__45, __pyx_k__45, sizeof(__pyx_k__45), 0, 0, 1, 0}, + {&__pyx_kp_s__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_kp_s__63, __pyx_k__63, sizeof(__pyx_k__63), 0, 0, 1, 0}, + {&__pyx_kp_s__64, __pyx_k__64, sizeof(__pyx_k__64), 0, 0, 1, 0}, + {&__pyx_kp_s__65, __pyx_k__65, sizeof(__pyx_k__65), 0, 0, 1, 0}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_add_instance_locals_extract, __pyx_k_add_instance_locals_extract, sizeof(__pyx_k_add_instance_locals_extract), 0, 0, 1, 1}, + {&__pyx_n_s_advance, __pyx_k_advance, sizeof(__pyx_k_advance), 0, 0, 1, 1}, + {&__pyx_n_s_al, __pyx_k_al, sizeof(__pyx_k_al), 0, 0, 1, 1}, + {&__pyx_n_s_alignment, __pyx_k_alignment, sizeof(__pyx_k_alignment), 0, 0, 1, 1}, + {&__pyx_n_s_alignments, __pyx_k_alignments, sizeof(__pyx_k_alignments), 0, 0, 1, 1}, + {&__pyx_n_s_alphabet_size, __pyx_k_alphabet_size, sizeof(__pyx_k_alphabet_size), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_arity, __pyx_k_arity, sizeof(__pyx_k_arity), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_arr_high, __pyx_k_arr_high, sizeof(__pyx_k_arr_high), 0, 0, 1, 1}, + {&__pyx_n_s_arr_low, __pyx_k_arr_low, sizeof(__pyx_k_arr_low), 0, 0, 1, 1}, + {&__pyx_n_s_bilex, __pyx_k_bilex, sizeof(__pyx_k_bilex), 0, 0, 1, 1}, + {&__pyx_n_s_by_slack_factor, __pyx_k_by_slack_factor, sizeof(__pyx_k_by_slack_factor), 0, 0, 1, 1}, + {&__pyx_n_s_category, __pyx_k_category, sizeof(__pyx_k_category), 0, 0, 1, 1}, + {&__pyx_kp_s_cdec_sa, __pyx_k_cdec_sa, sizeof(__pyx_k_cdec_sa), 0, 0, 1, 0}, + {&__pyx_n_s_cdec_sa__sa, __pyx_k_cdec_sa__sa, sizeof(__pyx_k_cdec_sa__sa), 0, 0, 1, 1}, + {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1}, + {&__pyx_n_s_children, __pyx_k_children, sizeof(__pyx_k_children), 0, 0, 1, 1}, + {&__pyx_n_s_cinit___locals_lambda, __pyx_k_cinit___locals_lambda, sizeof(__pyx_k_cinit___locals_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_cmp, __pyx_k_cmp, sizeof(__pyx_k_cmp), 0, 0, 1, 1}, + {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1}, + {&__pyx_n_s_collect, __pyx_k_collect, sizeof(__pyx_k_collect), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1}, + {&__pyx_n_s_ctx_name, __pyx_k_ctx_name, sizeof(__pyx_k_ctx_name), 0, 0, 1, 1}, + {&__pyx_n_s_curr_idx, __pyx_k_curr_idx, sizeof(__pyx_k_curr_idx), 0, 0, 1, 1}, + {&__pyx_kp_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 0}, + {&__pyx_kp_s_d_d, __pyx_k_d_d, sizeof(__pyx_k_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_d_d_2, __pyx_k_d_d_2, sizeof(__pyx_k_d_d_2), 0, 0, 1, 0}, + {&__pyx_kp_s_d_d_out_of_bounds_I_d_J_d_in_li, __pyx_k_d_d_out_of_bounds_I_d_J_d_in_li, sizeof(__pyx_k_d_d_out_of_bounds_I_d_J_d_in_li), 0, 0, 1, 0}, + {&__pyx_kp_s_d_f_f, __pyx_k_d_f_f, sizeof(__pyx_k_d_f_f), 0, 0, 1, 0}, + {&__pyx_kp_s_d_s, __pyx_k_d_s, sizeof(__pyx_k_d_s), 0, 0, 1, 0}, + {&__pyx_kp_s_d_sentences, __pyx_k_d_sentences, sizeof(__pyx_k_d_sentences), 0, 0, 1, 0}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_decode_lattice, __pyx_k_decode_lattice, sizeof(__pyx_k_decode_lattice), 0, 0, 1, 1}, + {&__pyx_n_s_decode_sentence, __pyx_k_decode_sentence, sizeof(__pyx_k_decode_sentence), 0, 0, 1, 1}, + {&__pyx_n_s_decode_words, __pyx_k_decode_words, sizeof(__pyx_k_decode_words), 0, 0, 1, 1}, + {&__pyx_n_s_defaultdict, __pyx_k_defaultdict, sizeof(__pyx_k_defaultdict), 0, 0, 1, 1}, + {&__pyx_n_s_dist, __pyx_k_dist, sizeof(__pyx_k_dist), 0, 0, 1, 1}, + {&__pyx_n_s_doquicksort, __pyx_k_doquicksort, sizeof(__pyx_k_doquicksort), 0, 0, 1, 1}, + {&__pyx_kp_s_double_binary, __pyx_k_double_binary, sizeof(__pyx_k_double_binary), 0, 0, 1, 0}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_e_i, __pyx_k_e_i, sizeof(__pyx_k_e_i), 0, 0, 1, 1}, + {&__pyx_n_s_e_j, __pyx_k_e_j, sizeof(__pyx_k_e_j), 0, 0, 1, 1}, + {&__pyx_n_s_e_span, __pyx_k_e_span, sizeof(__pyx_k_e_span), 0, 0, 1, 1}, + {&__pyx_n_s_e_text, __pyx_k_e_text, sizeof(__pyx_k_e_text), 0, 0, 1, 1}, + {&__pyx_n_s_e_words, __pyx_k_e_words, sizeof(__pyx_k_e_words), 0, 0, 1, 1}, + {&__pyx_n_s_earray, __pyx_k_earray, sizeof(__pyx_k_earray), 0, 0, 1, 1}, + {&__pyx_n_s_edarray, __pyx_k_edarray, sizeof(__pyx_k_edarray), 0, 0, 1, 1}, + {&__pyx_n_s_encode_words, __pyx_k_encode_words, sizeof(__pyx_k_encode_words), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_ephrase, __pyx_k_ephrase, sizeof(__pyx_k_ephrase), 0, 0, 1, 1}, + {&__pyx_n_s_eword, __pyx_k_eword, sizeof(__pyx_k_eword), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, + {&__pyx_n_s_extended, __pyx_k_extended, sizeof(__pyx_k_extended), 0, 0, 1, 1}, + {&__pyx_n_s_extract, __pyx_k_extract, sizeof(__pyx_k_extract), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_f_i, __pyx_k_f_i, sizeof(__pyx_k_f_i), 0, 0, 1, 1}, + {&__pyx_n_s_f_j, __pyx_k_f_j, sizeof(__pyx_k_f_j), 0, 0, 1, 1}, + {&__pyx_n_s_f_span, __pyx_k_f_span, sizeof(__pyx_k_f_span), 0, 0, 1, 1}, + {&__pyx_n_s_f_text, __pyx_k_f_text, sizeof(__pyx_k_f_text), 0, 0, 1, 1}, + {&__pyx_n_s_f_words, __pyx_k_f_words, sizeof(__pyx_k_f_words), 0, 0, 1, 1}, + {&__pyx_n_s_fcount, __pyx_k_fcount, sizeof(__pyx_k_fcount), 0, 0, 1, 1}, + {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, + {&__pyx_n_s_form_rule, __pyx_k_form_rule, sizeof(__pyx_k_form_rule), 0, 0, 1, 1}, + {&__pyx_n_s_form_rule_locals_lambda, __pyx_k_form_rule_locals_lambda, sizeof(__pyx_k_form_rule_locals_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fphrase, __pyx_k_fphrase, sizeof(__pyx_k_fphrase), 0, 0, 1, 1}, + {&__pyx_n_s_from_binary, __pyx_k_from_binary, sizeof(__pyx_k_from_binary), 0, 0, 1, 1}, + {&__pyx_n_s_from_data, __pyx_k_from_data, sizeof(__pyx_k_from_data), 0, 0, 1, 1}, + {&__pyx_n_s_from_iterable, __pyx_k_from_iterable, sizeof(__pyx_k_from_iterable), 0, 0, 1, 1}, + {&__pyx_n_s_from_stats, __pyx_k_from_stats, sizeof(__pyx_k_from_stats), 0, 0, 1, 1}, + {&__pyx_n_s_from_text, __pyx_k_from_text, sizeof(__pyx_k_from_text), 0, 0, 1, 1}, + {&__pyx_n_s_frontier, __pyx_k_frontier, sizeof(__pyx_k_frontier), 0, 0, 1, 1}, + {&__pyx_n_s_fsample_count, __pyx_k_fsample_count, sizeof(__pyx_k_fsample_count), 0, 0, 1, 1}, + {&__pyx_n_s_fsarray, __pyx_k_fsarray, sizeof(__pyx_k_fsarray), 0, 0, 1, 1}, + {&__pyx_n_s_fword, __pyx_k_fword, sizeof(__pyx_k_fword), 0, 0, 1, 1}, + {&__pyx_n_s_fwords, __pyx_k_fwords, sizeof(__pyx_k_fwords), 0, 0, 1, 1}, + {&__pyx_n_s_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 0, 1, 1}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_getLogger, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 0, 1, 1}, + {&__pyx_n_s_get_all_nodes_isteps_away, __pyx_k_get_all_nodes_isteps_away, sizeof(__pyx_k_get_all_nodes_isteps_away), 0, 0, 1, 1}, + {&__pyx_n_s_get_e_id, __pyx_k_get_e_id, sizeof(__pyx_k_get_e_id), 0, 0, 1, 1}, + {&__pyx_n_s_get_f_id, __pyx_k_get_f_id, sizeof(__pyx_k_get_f_id), 0, 0, 1, 1}, + {&__pyx_n_s_get_f_phrases, __pyx_k_get_f_phrases, sizeof(__pyx_k_get_f_phrases), 0, 0, 1, 1}, + {&__pyx_n_s_get_f_phrases_locals_extract, __pyx_k_get_f_phrases_locals_extract, sizeof(__pyx_k_get_f_phrases_locals_extract), 0, 0, 1, 1}, + {&__pyx_n_s_get_id, __pyx_k_get_id, sizeof(__pyx_k_get_id), 0, 0, 1, 1}, + {&__pyx_n_s_get_next_states, __pyx_k_get_next_states, sizeof(__pyx_k_get_next_states), 0, 0, 1, 1}, + {&__pyx_n_s_get_precomputed_collocation, __pyx_k_get_precomputed_collocation, sizeof(__pyx_k_get_precomputed_collocation), 0, 0, 1, 1}, + {&__pyx_n_s_get_word, __pyx_k_get_word, sizeof(__pyx_k_get_word), 0, 0, 1, 1}, + {&__pyx_n_s_getchunk, __pyx_k_getchunk, sizeof(__pyx_k_getchunk), 0, 0, 1, 1}, + {&__pyx_n_s_getrusage, __pyx_k_getrusage, sizeof(__pyx_k_getrusage), 0, 0, 1, 1}, + {&__pyx_kp_s_gz, __pyx_k_gz, sizeof(__pyx_k_gz), 0, 0, 1, 0}, + {&__pyx_n_s_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_gzip_or_text, __pyx_k_gzip_or_text, sizeof(__pyx_k_gzip_or_text), 0, 0, 1, 1}, + {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, + {&__pyx_n_s_high, __pyx_k_high, sizeof(__pyx_k_high), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_ifrom, __pyx_k_ifrom, sizeof(__pyx_k_ifrom), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_increment, __pyx_k_increment, sizeof(__pyx_k_increment), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, + {&__pyx_n_s_initial_len, __pyx_k_initial_len, sizeof(__pyx_k_initial_len), 0, 0, 1, 1}, + {&__pyx_n_s_input_locals_lambda, __pyx_k_input_locals_lambda, sizeof(__pyx_k_input_locals_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_input_locals_lambda_locals_lambd, __pyx_k_input_locals_lambda_locals_lambd, sizeof(__pyx_k_input_locals_lambda_locals_lambd), 0, 0, 1, 1}, + {&__pyx_n_s_input_match, __pyx_k_input_match, sizeof(__pyx_k_input_match), 0, 0, 1, 1}, + {&__pyx_n_s_input_span, __pyx_k_input_span, sizeof(__pyx_k_input_span), 0, 0, 1, 1}, + {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, + {&__pyx_n_s_isa, __pyx_k_isa, sizeof(__pyx_k_isa), 0, 0, 1, 1}, + {&__pyx_n_s_isvar, __pyx_k_isvar, sizeof(__pyx_k_isvar), 0, 0, 1, 1}, + {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, + {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1}, + {&__pyx_n_s_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 0, 0, 1, 1}, + {&__pyx_n_s_ito, __pyx_k_ito, sizeof(__pyx_k_ito), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_lattice, __pyx_k_lattice, sizeof(__pyx_k_lattice), 0, 0, 1, 1}, + {&__pyx_kp_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 0}, + {&__pyx_n_s_lex_i, __pyx_k_lex_i, sizeof(__pyx_k_lex_i), 0, 0, 1, 1}, + {&__pyx_n_s_lex_j, __pyx_k_lex_j, sizeof(__pyx_k_lex_j), 0, 0, 1, 1}, + {&__pyx_n_s_lhs, __pyx_k_lhs, sizeof(__pyx_k_lhs), 0, 0, 1, 1}, + {&__pyx_n_s_link, __pyx_k_link, sizeof(__pyx_k_link), 0, 0, 1, 1}, + {&__pyx_n_s_link_i, __pyx_k_link_i, sizeof(__pyx_k_link_i), 0, 0, 1, 1}, + {&__pyx_n_s_link_j, __pyx_k_link_j, sizeof(__pyx_k_link_j), 0, 0, 1, 1}, + {&__pyx_n_s_links, __pyx_k_links, sizeof(__pyx_k_links), 0, 0, 1, 1}, + {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1}, + {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1}, + {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, + {&__pyx_n_s_low, __pyx_k_low, sizeof(__pyx_k_low), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_make_lattice, __pyx_k_make_lattice, sizeof(__pyx_k_make_lattice), 0, 0, 1, 1}, + {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, + {&__pyx_n_s_matches, __pyx_k_matches, sizeof(__pyx_k_matches), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_max_chunks, __pyx_k_max_chunks, sizeof(__pyx_k_max_chunks), 0, 0, 1, 1}, + {&__pyx_n_s_max_initial_size, __pyx_k_max_initial_size, sizeof(__pyx_k_max_initial_size), 0, 0, 1, 1}, + {&__pyx_n_s_max_length, __pyx_k_max_length, sizeof(__pyx_k_max_length), 0, 0, 1, 1}, + {&__pyx_n_s_max_nonterminals, __pyx_k_max_nonterminals, sizeof(__pyx_k_max_nonterminals), 0, 0, 1, 1}, + {&__pyx_n_s_max_target_chunks, __pyx_k_max_target_chunks, sizeof(__pyx_k_max_target_chunks), 0, 0, 1, 1}, + {&__pyx_n_s_max_target_length, __pyx_k_max_target_length, sizeof(__pyx_k_max_target_length), 0, 0, 1, 1}, + {&__pyx_n_s_merge, __pyx_k_merge, sizeof(__pyx_k_merge), 0, 0, 1, 1}, + {&__pyx_n_s_meta, __pyx_k_meta, sizeof(__pyx_k_meta), 0, 0, 1, 1}, + {&__pyx_n_s_min_bound, __pyx_k_min_bound, sizeof(__pyx_k_min_bound), 0, 0, 1, 1}, + {&__pyx_n_s_min_dist, __pyx_k_min_dist, sizeof(__pyx_k_min_dist), 0, 0, 1, 1}, + {&__pyx_n_s_min_gap_size, __pyx_k_min_gap_size, sizeof(__pyx_k_min_gap_size), 0, 0, 1, 1}, + {&__pyx_n_s_monitor_cpu, __pyx_k_monitor_cpu, sizeof(__pyx_k_monitor_cpu), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1}, + {&__pyx_n_s_new_e_i, __pyx_k_new_e_i, sizeof(__pyx_k_new_e_i), 0, 0, 1, 1}, + {&__pyx_n_s_new_e_j, __pyx_k_new_e_j, sizeof(__pyx_k_new_e_j), 0, 0, 1, 1}, + {&__pyx_n_s_new_lex_i, __pyx_k_new_lex_i, sizeof(__pyx_k_new_lex_i), 0, 0, 1, 1}, + {&__pyx_n_s_new_lex_j, __pyx_k_new_lex_j, sizeof(__pyx_k_new_lex_j), 0, 0, 1, 1}, + {&__pyx_n_s_new_min_bound, __pyx_k_new_min_bound, sizeof(__pyx_k_new_min_bound), 0, 0, 1, 1}, + {&__pyx_n_s_next_states, __pyx_k_next_states, sizeof(__pyx_k_next_states), 0, 0, 1, 1}, + {&__pyx_n_s_nt, __pyx_k_nt, sizeof(__pyx_k_nt), 0, 0, 1, 1}, + {&__pyx_n_s_nt_collision, __pyx_k_nt_collision, sizeof(__pyx_k_nt_collision), 0, 0, 1, 1}, + {&__pyx_n_s_nt_open, __pyx_k_nt_open, sizeof(__pyx_k_nt_open), 0, 0, 1, 1}, + {&__pyx_n_s_ntc, __pyx_k_ntc, sizeof(__pyx_k_ntc), 0, 0, 1, 1}, + {&__pyx_n_s_num_subpatterns, __pyx_k_num_subpatterns, sizeof(__pyx_k_num_subpatterns), 0, 0, 1, 1}, + {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, + {&__pyx_n_s_old_last_nt, __pyx_k_old_last_nt, sizeof(__pyx_k_old_last_nt), 0, 0, 1, 1}, + {&__pyx_n_s_online, __pyx_k_online, sizeof(__pyx_k_online), 0, 0, 1, 1}, + {&__pyx_n_s_online_ctx_lookup, __pyx_k_online_ctx_lookup, sizeof(__pyx_k_online_ctx_lookup), 0, 0, 1, 1}, + {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, + {&__pyx_n_s_pad, __pyx_k_pad, sizeof(__pyx_k_pad), 0, 0, 1, 1}, + {&__pyx_n_s_paircount, __pyx_k_paircount, sizeof(__pyx_k_paircount), 0, 0, 1, 1}, + {&__pyx_n_s_partition, __pyx_k_partition, sizeof(__pyx_k_partition), 0, 0, 1, 1}, + {&__pyx_n_s_pathlen, __pyx_k_pathlen, sizeof(__pyx_k_pathlen), 0, 0, 1, 1}, + {&__pyx_n_s_pattern2phrase, __pyx_k_pattern2phrase, sizeof(__pyx_k_pattern2phrase), 0, 0, 1, 1}, + {&__pyx_n_s_pattern2phrase_plus, __pyx_k_pattern2phrase_plus, sizeof(__pyx_k_pattern2phrase_plus), 0, 0, 1, 1}, + {&__pyx_n_s_phrase, __pyx_k_phrase, sizeof(__pyx_k_phrase), 0, 0, 1, 1}, + {&__pyx_n_s_phrase_location, __pyx_k_phrase_location, sizeof(__pyx_k_phrase_location), 0, 0, 1, 1}, + {&__pyx_n_s_phrases_al, __pyx_k_phrases_al, sizeof(__pyx_k_phrases_al), 0, 0, 1, 1}, + {&__pyx_n_s_phrases_e, __pyx_k_phrases_e, sizeof(__pyx_k_phrases_e), 0, 0, 1, 1}, + {&__pyx_n_s_phrases_f, __pyx_k_phrases_f, sizeof(__pyx_k_phrases_f), 0, 0, 1, 1}, + {&__pyx_n_s_phrases_fe, __pyx_k_phrases_fe, sizeof(__pyx_k_phrases_fe), 0, 0, 1, 1}, + {&__pyx_n_s_plus_links, __pyx_k_plus_links, sizeof(__pyx_k_plus_links), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_precompute, __pyx_k_precompute, sizeof(__pyx_k_precompute), 0, 0, 1, 1}, + {&__pyx_n_s_precompute_file, __pyx_k_precompute_file, sizeof(__pyx_k_precompute_file), 0, 0, 1, 1}, + {&__pyx_n_s_precompute_rank, __pyx_k_precompute_rank, sizeof(__pyx_k_precompute_rank), 0, 0, 1, 1}, + {&__pyx_n_s_precompute_secondary_rank, __pyx_k_precompute_secondary_rank, sizeof(__pyx_k_precompute_secondary_rank), 0, 0, 1, 1}, + {&__pyx_n_s_precomputed, __pyx_k_precomputed, sizeof(__pyx_k_precomputed), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_q3sort, __pyx_k_q3sort, sizeof(__pyx_k_q3sort), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reachable, __pyx_k_reachable, sizeof(__pyx_k_reachable), 0, 0, 1, 1}, + {&__pyx_n_s_reachable_buffer, __pyx_k_reachable_buffer, sizeof(__pyx_k_reachable_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_read_binary, __pyx_k_read_binary, sizeof(__pyx_k_read_binary), 0, 0, 1, 1}, + {&__pyx_n_s_read_bitext, __pyx_k_read_bitext, sizeof(__pyx_k_read_bitext), 0, 0, 1, 1}, + {&__pyx_n_s_read_text, __pyx_k_read_text, sizeof(__pyx_k_read_text), 0, 0, 1, 1}, + {&__pyx_n_s_read_text_data, __pyx_k_read_text_data, sizeof(__pyx_k_read_text_data), 0, 0, 1, 1}, + {&__pyx_n_s_require_aligned_chunks, __pyx_k_require_aligned_chunks, sizeof(__pyx_k_require_aligned_chunks), 0, 0, 1, 1}, + {&__pyx_n_s_require_aligned_terminal, __pyx_k_require_aligned_terminal, sizeof(__pyx_k_require_aligned_terminal), 0, 0, 1, 1}, + {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, + {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1}, + {&__pyx_n_s_resource, __pyx_k_resource, sizeof(__pyx_k_resource), 0, 0, 1, 1}, + {&__pyx_n_s_ru_stime, __pyx_k_ru_stime, sizeof(__pyx_k_ru_stime), 0, 0, 1, 1}, + {&__pyx_n_s_ru_utime, __pyx_k_ru_utime, sizeof(__pyx_k_ru_utime), 0, 0, 1, 1}, + {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 0}, + {&__pyx_kp_s_s_d, __pyx_k_s_d, sizeof(__pyx_k_s_d), 0, 0, 1, 0}, + {&__pyx_kp_s_s_d_2, __pyx_k_s_d_2, sizeof(__pyx_k_s_d_2), 0, 0, 1, 0}, + {&__pyx_kp_s_s_not_in_IntList, __pyx_k_s_not_in_IntList, sizeof(__pyx_k_s_not_in_IntList), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_6f_6f, __pyx_k_s_s_6f_6f, sizeof(__pyx_k_s_s_6f_6f), 0, 0, 1, 0}, + {&__pyx_n_s_sa, __pyx_k_sa, sizeof(__pyx_k_sa), 0, 0, 1, 1}, + {&__pyx_n_s_sa_high, __pyx_k_sa_high, sizeof(__pyx_k_sa_high), 0, 0, 1, 1}, + {&__pyx_n_s_sa_low, __pyx_k_sa_low, sizeof(__pyx_k_sa_low), 0, 0, 1, 1}, + {&__pyx_n_s_sample, __pyx_k_sample, sizeof(__pyx_k_sample), 0, 0, 1, 1}, + {&__pyx_n_s_sample_size, __pyx_k_sample_size, sizeof(__pyx_k_sample_size), 0, 0, 1, 1}, + {&__pyx_n_s_sampler, __pyx_k_sampler, sizeof(__pyx_k_sampler), 0, 0, 1, 1}, + {&__pyx_n_s_samples_f, __pyx_k_samples_f, sizeof(__pyx_k_samples_f), 0, 0, 1, 1}, + {&__pyx_n_s_sarray, __pyx_k_sarray, sizeof(__pyx_k_sarray), 0, 0, 1, 1}, + {&__pyx_n_s_scorer, __pyx_k_scorer, sizeof(__pyx_k_scorer), 0, 0, 1, 1}, + {&__pyx_n_s_scores, __pyx_k_scores, sizeof(__pyx_k_scores), 0, 0, 1, 1}, + {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, + {&__pyx_n_s_shortest, __pyx_k_shortest, sizeof(__pyx_k_shortest), 0, 0, 1, 1}, + {&__pyx_n_s_side, __pyx_k_side, sizeof(__pyx_k_side), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 0, 0, 1, 1}, + {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1}, + {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, + {&__pyx_n_s_span_check, __pyx_k_span_check, sizeof(__pyx_k_span_check), 0, 0, 1, 1}, + {&__pyx_n_s_span_dec, __pyx_k_span_dec, sizeof(__pyx_k_span_dec), 0, 0, 1, 1}, + {&__pyx_n_s_span_inc, __pyx_k_span_inc, sizeof(__pyx_k_span_inc), 0, 0, 1, 1}, + {&__pyx_n_s_spanlen, __pyx_k_spanlen, sizeof(__pyx_k_spanlen), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_stats, __pyx_k_stats, sizeof(__pyx_k_stats), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 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_syms, __pyx_k_syms, sizeof(__pyx_k_syms), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_test_sentence, __pyx_k_test_sentence, sizeof(__pyx_k_test_sentence), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 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}, + {&__pyx_n_s_train_max_initial_size, __pyx_k_train_max_initial_size, sizeof(__pyx_k_train_max_initial_size), 0, 0, 1, 1}, + {&__pyx_n_s_train_min_gap_size, __pyx_k_train_min_gap_size, sizeof(__pyx_k_train_min_gap_size), 0, 0, 1, 1}, + {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_s_use_baeza_yates, __pyx_k_use_baeza_yates, sizeof(__pyx_k_use_baeza_yates), 0, 0, 1, 1}, + {&__pyx_n_s_use_collocations, __pyx_k_use_collocations, sizeof(__pyx_k_use_collocations), 0, 0, 1, 1}, + {&__pyx_n_s_use_index, __pyx_k_use_index, sizeof(__pyx_k_use_index), 0, 0, 1, 1}, + {&__pyx_n_s_use_sent_id, __pyx_k_use_sent_id, sizeof(__pyx_k_use_sent_id), 0, 0, 1, 1}, + {&__pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt, __pyx_k_usr0_home_mdenkows_cdec_git_pyt, sizeof(__pyx_k_usr0_home_mdenkows_cdec_git_pyt), 0, 0, 1, 0}, + {&__pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_2, __pyx_k_usr0_home_mdenkows_cdec_git_pyt_2, sizeof(__pyx_k_usr0_home_mdenkows_cdec_git_pyt_2), 0, 0, 1, 0}, + {&__pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_3, __pyx_k_usr0_home_mdenkows_cdec_git_pyt_3, sizeof(__pyx_k_usr0_home_mdenkows_cdec_git_pyt_3), 0, 0, 1, 0}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1}, + {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, + {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, + {&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1}, + {&__pyx_n_s_wc, __pyx_k_wc, sizeof(__pyx_k_wc), 0, 0, 1, 1}, + {&__pyx_n_s_word, __pyx_k_word, sizeof(__pyx_k_word), 0, 0, 1, 1}, + {&__pyx_n_s_word_alignments, __pyx_k_word_alignments, sizeof(__pyx_k_word_alignments), 0, 0, 1, 1}, + {&__pyx_n_s_word_ids, __pyx_k_word_ids, sizeof(__pyx_k_word_ids), 0, 0, 1, 1}, + {&__pyx_n_s_words, __pyx_k_words, sizeof(__pyx_k_words), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_write_enhanced_handle, __pyx_k_write_enhanced_handle, sizeof(__pyx_k_write_enhanced_handle), 0, 0, 1, 1}, + {&__pyx_n_s_write_text, __pyx_k_write_text, sizeof(__pyx_k_write_text), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s__open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__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_GetBuiltinName(__pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__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_GetBuiltinName(__pyx_n_s_cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -75020,611 +77388,655 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":20 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":20 * self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1} * self.id2word = ["END_OF_FILE", "END_OF_LINE"] * self.data = IntList(1000,1000) # <<<<<<<<<<<<<< * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) */ - __pyx_k_tuple_11 = PyTuple_Pack(2, __pyx_int_1000, __pyx_int_1000); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_11); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); + __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_1000, __pyx_int_1000); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":21 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":21 * self.id2word = ["END_OF_FILE", "END_OF_LINE"] * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) # <<<<<<<<<<<<<< * self.sent_index = IntList(1000,1000) * self.use_sent_id = use_sent_id */ - __pyx_k_tuple_12 = PyTuple_Pack(2, __pyx_int_1000, __pyx_int_1000); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_12); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); + __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_1000, __pyx_int_1000); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":22 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":22 * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< * self.use_sent_id = use_sent_id * if from_binary: */ - __pyx_k_tuple_13 = PyTuple_Pack(2, __pyx_int_1000, __pyx_int_1000); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_13); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13)); + __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_1000, __pyx_int_1000); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":66 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":66 * f.write("%s " % self.get_word(w_id)) * if w_id == 1: * f.write("\n") # <<<<<<<<<<<<<< * * def read_text(self, char* filename): */ - __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_16); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16)); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":61 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< * for w_id in self.data: * if w_id > 1: */ - __pyx_k_tuple_17 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_17); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); + __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":69 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":69 * * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< * self.read_text_data(fp) * */ - __pyx_k_tuple_18 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_18); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18)); + __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":74 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":74 * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: * data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<< * self.read_text_data(data) * */ - __pyx_k_tuple_20 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_19)); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_20); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20)); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s__10); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":73 * * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< * data = (line.split(' ||| ')[side] for line in fp) * self.read_text_data(data) */ - __pyx_k_tuple_21 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_21); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21)); + __pyx_tuple__12 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":130 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":130 * num_words = len(self.id2word) - 2 * fwrite(&(num_words), sizeof(int), 1, f) * for word in self.id2word[2:]: # <<<<<<<<<<<<<< * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) */ - __pyx_k_slice_22 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_k_slice_22)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_slice_22); - __Pyx_GIVEREF(__pyx_k_slice_22); + __pyx_slice__13 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__13); + __Pyx_GIVEREF(__pyx_slice__13); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":144 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":144 * for i in self.data: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< * for i in self.sent_index: * f.write("%d " %i) */ - __pyx_k_tuple_24 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_24); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":147 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":147 * for i in self.sent_index: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< * for i in self.sent_id: * f.write("%d " %i) */ - __pyx_k_tuple_25 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_25); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25)); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":150 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":150 * for i in self.sent_id: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) */ - __pyx_k_tuple_26 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_26); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26)); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":153 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":153 * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) * f.write("\n") # <<<<<<<<<<<<<< * * def write_enhanced(self, char* filename): */ - __pyx_k_tuple_28 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_28); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28)); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); - /* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":156 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/data_array.pxi":156 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< * self.write_enhanced_handle(self, f) */ - __pyx_k_tuple_30 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_30); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30)); + __pyx_tuple__18 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":48 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":48 * * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) # <<<<<<<<<<<<<< * self.sent_index = IntList(1000,1000) * if from_binary: */ - __pyx_k_tuple_31 = PyTuple_Pack(2, __pyx_int_1000, __pyx_int_1000); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_31); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31)); + __pyx_tuple__19 = PyTuple_Pack(2, __pyx_int_1000, __pyx_int_1000); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":49 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":49 * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< * if from_binary: * self.read_binary(from_binary) */ - __pyx_k_tuple_32 = PyTuple_Pack(2, __pyx_int_1000, __pyx_int_1000); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_32); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32)); + __pyx_tuple__20 = PyTuple_Pack(2, __pyx_int_1000, __pyx_int_1000); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":61 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":61 * pairs = line.split() * for pair in pairs: * (i, j) = map(int, pair.split('-')) # <<<<<<<<<<<<<< * self.links.append(self.link(i, j)) * self.sent_index.append(len(self.links)) */ - __pyx_k_tuple_34 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_34); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34)); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s__21); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":56 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":56 * * def read_text(self, char* filename): * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< * for line in f: * self.sent_index.append(len(self.links)) */ - __pyx_k_tuple_35 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_35); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35)); + __pyx_tuple__23 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":77 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":77 * for i, link in enumerate(self.links): * while i >= self.sent_index[sent_num]: * f.write("\n") # <<<<<<<<<<<<<< * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) */ - __pyx_k_tuple_36 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_36); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36)); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":80 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":80 * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) * f.write("\n") # <<<<<<<<<<<<<< * * def write_binary(self, char* filename): */ - __pyx_k_tuple_38 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_38); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38)); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":73 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":73 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< * sent_num = 0 * for i, link in enumerate(self.links): */ - __pyx_k_tuple_39 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_39); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39)); + __pyx_tuple__26 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":93 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":93 * for link in self.links: * f.write("%d " % link) * f.write("\n") # <<<<<<<<<<<<<< * for i in self.sent_index: * f.write("%d " % i) */ - __pyx_k_tuple_40 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_40); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40)); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":96 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":96 * for i in self.sent_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< * * def alignment(self, i): */ - __pyx_k_tuple_41 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_41); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41)); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":90 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":90 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< * for link in self.links: * f.write("%d " % link) */ - __pyx_k_tuple_42 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_42); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42)); + __pyx_tuple__29 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":305 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":305 * * # Re-read file, placing words into buckets * f.seek(0) # <<<<<<<<<<<<<< * for line in f: * (fword, eword, score1, score2) = line.split() */ - __pyx_k_tuple_45 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_45); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45)); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":281 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":281 * * fcount = IntList() * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< * # first loop merely establishes size of array objects * for line in f: */ - __pyx_k_tuple_46 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_46); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46)); + __pyx_tuple__31 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":347 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":347 * * if i > j: * raise Exception("Sort error in CLex") # <<<<<<<<<<<<<< * if i == j: #empty interval * return */ - __pyx_k_tuple_49 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_49); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49)); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Sort_error_in_CLex); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":370 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":370 * for i in self.f_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) */ - __pyx_k_tuple_51 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_51); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51)); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":373 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":373 * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) * f.write("\n") # <<<<<<<<<<<<<< * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) */ - __pyx_k_tuple_53 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_53); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53)); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":376 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":376 * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) */ - __pyx_k_tuple_55 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_55); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55)); + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":379 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":379 * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< * * */ - __pyx_k_tuple_56 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_56); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56)); + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":367 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":367 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< * for i in self.f_index: * f.write("%d " % i) */ - __pyx_k_tuple_57 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_57); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57)); + __pyx_tuple__39 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":412 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/bilex.pxi":412 * cdef i, N, e_id, f_id * * with open(filename, "w") as f: # <<<<<<<<<<<<<< * N = len(self.e_index) * f_id = 0 */ - __pyx_k_tuple_59 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_59); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59)); + __pyx_tuple__40 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":13 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":13 * cdef IntList rank * * logger.info("Constructing LCP array") # <<<<<<<<<<<<<< * self.sa = sa * n = self.sa.sa.len */ - __pyx_k_tuple_63 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_63); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63)); + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Constructing_LCP_array); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); - /* "/home/mdenkows/cdec/python/cdec/sa/lcp.pxi":34 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/lcp.pxi":34 * if h > 0: * h = h-1 * logger.info("LCP array completed") # <<<<<<<<<<<<<< * * def compute_stats(self, int max_n): */ - __pyx_k_tuple_65 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_65); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65)); + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_LCP_array_completed); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":297 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":297 * pattern_rank = {} * * logger.info("Precomputing frequent intersections") # <<<<<<<<<<<<<< * cdef float start_time = monitor_cpu() * */ - __pyx_k_tuple_75 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_74)); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_75); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75)); + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_Precomputing_frequent_intersecti); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":314 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":314 * queue = IntList(increment=1000) * * logger.info(" Computing inverted indexes...") # <<<<<<<<<<<<<< * N = len(data) * for i from 0 <= i < N: */ - __pyx_k_tuple_77 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_76)); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_77); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_77)); + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_Computing_inverted_indexes); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":329 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":329 * trie_node_data_append(node, i) * * logger.info(" Computing collocations...") # <<<<<<<<<<<<<< * N = len(queue) * ptr1 = 0 */ - __pyx_k_tuple_79 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_78)); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_79); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_79)); + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Computing_collocations); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":393 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":386 + * ptr1 = ptr1 + 1 + * + * self.precomputed_collocations = collocations.toMap(False) # <<<<<<<<<<<<<< + * self.precomputed_index = frequent_patterns.toMap(True) + * + */ + __pyx_tuple__50 = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":387 + * + * self.precomputed_collocations = collocations.toMap(False) + * self.precomputed_index = frequent_patterns.toMap(True) # <<<<<<<<<<<<<< + * + * x = 0 + */ + __pyx_tuple__51 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":393 * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< * J2_set.add(combined_pattern) * */ - __pyx_k_tuple_81 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_81)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_81); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_81)); + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":400 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":400 * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< * IJ_set.add(combined_pattern) * */ - __pyx_k_tuple_82 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_82); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82)); + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":407 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":407 * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 */ - __pyx_k_tuple_83 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_83); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_83)); + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); - /* "/home/mdenkows/cdec/python/cdec/sa/precomputation.pxi":409 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/precomputation.pxi":409 * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 # <<<<<<<<<<<<<< * IJ_set.add(combined_pattern) * */ - __pyx_k_tuple_84 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_84); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_84)); + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":94 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":94 * * '''Step 3: read off suffix array from inverse suffix array''' * logger.info(" Finalizing sort...") # <<<<<<<<<<<<<< * for i from 0 <= i < N: * j = isa.arr[i] */ - __pyx_k_tuple_95 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_94)); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_95); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_95)); + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Finalizing_sort); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":193 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":193 * for a_i in self.sa: * f.write("%d " % a_i) * f.write("\n") # <<<<<<<<<<<<<< * for w_i in self.ha: * f.write("%d " % w_i) */ - __pyx_k_tuple_98 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_98); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98)); + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":196 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":196 * for w_i in self.ha: * f.write("%d " % w_i) * f.write("\n") # <<<<<<<<<<<<<< * * cdef int __search_high(self, int word_id, int offset, int low, int high): */ - __pyx_k_tuple_99 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_99); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_99)); + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); - /* "/home/mdenkows/cdec/python/cdec/sa/suffix_array.pxi":189 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/suffix_array.pxi":189 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< * self.darray.write_enhanced_handle(f) * for a_i in self.sa: */ - __pyx_k_tuple_100 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_100); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100)); + __pyx_tuple__59 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":133 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":133 * logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) * else: * logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<< * * def sample(self, PhraseLocation phrase_location): */ - __pyx_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_105)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_106); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_106)); + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_Sampling_strategy_no_sampling); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":346 + * respectively. This is because Chiang's model does not require + * them to be the same, therefore we don't either.''' + * self.rules = TrieTable(True) # cache # <<<<<<<<<<<<<< + * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) + * if alignment is None: + */ + __pyx_tuple__61 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":346 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":349 * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: * raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<< * self.alignment = alignment * */ - __pyx_k_tuple_111 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_110)); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_111); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_111)); + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Must_specify_an_alignment_object); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1058 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1064 * else: * #ERROR: We never get here * raise Exception("Keyword trie error") # <<<<<<<<<<<<<< * # checking whether lookup_required * if lookup_required: */ - __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_126)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_127); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_127)); + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_Keyword_trie_error); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1977 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1983 * if nt and nt[-1][2] == f_j - 1: * # Add to non-terminal, checking for collisions * old_last_nt = nt[-1][:] # <<<<<<<<<<<<<< * nt[-1][2] = f_j * if link_i < nt[-1][3]: */ - __pyx_k_slice_141 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_141)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_slice_141); - __Pyx_GIVEREF(__pyx_k_slice_141); + __pyx_slice__67 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__67)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__67); + __Pyx_GIVEREF(__pyx_slice__67); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":1920 * # f_ i and j are current, e_ i and j are previous * # We care _considering_ f_j, so it is not yet in counts * def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<< * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: */ - __pyx_k_tuple_142 = PyTuple_Pack(19, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__e_i), ((PyObject *)__pyx_n_s__e_j), ((PyObject *)__pyx_n_s__min_bound), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__links), ((PyObject *)__pyx_n_s__nt), ((PyObject *)__pyx_n_s__nt_open), ((PyObject *)__pyx_n_s__link_i), ((PyObject *)__pyx_n_s__link_j), ((PyObject *)__pyx_n_s__new_e_i), ((PyObject *)__pyx_n_s__new_e_j), ((PyObject *)__pyx_n_s__new_min_bound), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__nt_collision), ((PyObject *)__pyx_n_s__link), ((PyObject *)__pyx_n_s__plus_links), ((PyObject *)__pyx_n_s__old_last_nt)); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_142); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142)); - __pyx_k_codeobj_143 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 1914, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_143)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__68 = PyTuple_Pack(19, __pyx_n_s_f_i, __pyx_n_s_f_j, __pyx_n_s_e_i, __pyx_n_s_e_j, __pyx_n_s_min_bound, __pyx_n_s_wc, __pyx_n_s_links, __pyx_n_s_nt, __pyx_n_s_nt_open, __pyx_n_s_link_i, __pyx_n_s_link_j, __pyx_n_s_new_e_i, __pyx_n_s_new_e_j, __pyx_n_s_new_min_bound, __pyx_n_s_i, __pyx_n_s_nt_collision, __pyx_n_s_link, __pyx_n_s_plus_links, __pyx_n_s_old_last_nt); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt, __pyx_n_s_extract, 1920, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2036 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2042 * # Update phrase counts * for rule in rules: * (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<< * stats.phrases_f[f_ph] += 1 * stats.phrases_e[e_ph] += 1 */ - __pyx_k_slice_146 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_k_slice_146)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_slice_146); - __Pyx_GIVEREF(__pyx_k_slice_146); + __pyx_slice__70 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__70)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__70); + __Pyx_GIVEREF(__pyx_slice__70); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2048 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2053 + * self.bilex.update(f_words, e_words, alignment) + * else: + * logger.warning('No online bilexical dictionary specified, not updating lexical weights') # <<<<<<<<<<<<<< + * + * # Create a rule from source, target, non-terminals, and alignments + */ + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_No_online_bilexical_dictionary_s); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2060 * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) # <<<<<<<<<<<<<< * off = f_i * for next_nt in nt: */ - __pyx_k_slice_148 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_slice_148); - __Pyx_GIVEREF(__pyx_k_slice_148); + __pyx_slice__72 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__72)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__72); + __Pyx_GIVEREF(__pyx_slice__72); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2058 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2070 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) * e_sym = list(e_span[:]) # <<<<<<<<<<<<<< * off = e_i * for next_nt in nt_inv: */ - __pyx_k_slice_149 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_slice_149); - __Pyx_GIVEREF(__pyx_k_slice_149); + __pyx_slice__73 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__73)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__73); + __Pyx_GIVEREF(__pyx_slice__73); - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2133 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2145 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: */ - __pyx_k_tuple_153 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__lex_i), ((PyObject *)__pyx_n_s__lex_j), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__ntc), ((PyObject *)__pyx_n_s__syms), ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__new_lex_i), ((PyObject *)__pyx_n_s__new_lex_j)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_153); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153)); - __pyx_k_codeobj_154 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 2133, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__74 = PyTuple_Pack(10, __pyx_n_s_f_i, __pyx_n_s_f_j, __pyx_n_s_lex_i, __pyx_n_s_lex_j, __pyx_n_s_wc, __pyx_n_s_ntc, __pyx_n_s_syms, __pyx_n_s_f, __pyx_n_s_new_lex_i, __pyx_n_s_new_lex_j); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt, __pyx_n_s_extract, 2145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "cdec/sa/_sa.pyx":5 * import gzip @@ -75633,7 +78045,7 @@ static int __Pyx_InitCachedConstants(void) { * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ * resource.getrusage(resource.RUSAGE_SELF).ru_stime) */ - __pyx_k_codeobj_157 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_158, __pyx_n_s__monitor_cpu, 5, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_2, __pyx_n_s_monitor_cpu, 5, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "cdec/sa/_sa.pyx":9 * resource.getrusage(resource.RUSAGE_SELF).ru_stime) @@ -75642,10 +78054,10 @@ static int __Pyx_InitCachedConstants(void) { * if filename.endswith('.gz'): * return gzip.GzipFile(filename) */ - __pyx_k_tuple_159 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__filename), ((PyObject *)__pyx_n_s__filename)); if (unlikely(!__pyx_k_tuple_159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_159); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_159)); - __pyx_k_codeobj_160 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_158, __pyx_n_s__gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__77 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_2, __pyx_n_s_gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "cdec/sa/_sa.pyx":15 * return open(filename) @@ -75654,116 +78066,116 @@ static int __Pyx_InitCachedConstants(void) { * * include "float_list.pxi" */ - __pyx_k_tuple_162 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_161)); if (unlikely(!__pyx_k_tuple_162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_162); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_162)); + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_cdec_sa); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":107 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":107 * return ALPHABET.fromstring(string, terminal) * * def isvar(sym): # <<<<<<<<<<<<<< * return sym_isvar(sym) * */ - __pyx_k_tuple_163 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__sym)); if (unlikely(!__pyx_k_tuple_163)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_163); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_163)); - __pyx_k_codeobj_164 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_165, __pyx_n_s__isvar, 107, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_164)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_s_sym); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_3, __pyx_n_s_isvar, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":110 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":110 * return sym_isvar(sym) * * def make_lattice(words): # <<<<<<<<<<<<<< * word_ids = (sym_fromstring(word, True) for word in words) * return tuple(((word, None, 1), ) for word in word_ids) */ - __pyx_k_tuple_166 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__words), ((PyObject *)__pyx_n_s__word_ids), ((PyObject *)__pyx_n_s__genexpr), ((PyObject *)__pyx_n_s__genexpr), ((PyObject *)__pyx_n_s__genexpr)); if (unlikely(!__pyx_k_tuple_166)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_166); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_166)); - __pyx_k_codeobj_167 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_165, __pyx_n_s__make_lattice, 110, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_167)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__82 = PyTuple_Pack(5, __pyx_n_s_words, __pyx_n_s_word_ids, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_3, __pyx_n_s_make_lattice, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":114 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":114 * return tuple(((word, None, 1), ) for word in word_ids) * * def decode_lattice(lattice): # <<<<<<<<<<<<<< * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc * for arc in node for node in lattice) */ - __pyx_k_tuple_168 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__lattice), ((PyObject *)__pyx_n_s__genexpr), ((PyObject *)__pyx_n_s__genexpr)); if (unlikely(!__pyx_k_tuple_168)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_168); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_168)); - __pyx_k_codeobj_169 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_165, __pyx_n_s__decode_lattice, 114, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_169)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__84 = PyTuple_Pack(3, __pyx_n_s_lattice, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_3, __pyx_n_s_decode_lattice, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":118 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":118 * for arc in node for node in lattice) * * def decode_sentence(lattice): # <<<<<<<<<<<<<< * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) * */ - __pyx_k_tuple_170 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__lattice), ((PyObject *)__pyx_n_s__genexpr), ((PyObject *)__pyx_n_s__genexpr)); if (unlikely(!__pyx_k_tuple_170)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_170); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_170)); - __pyx_k_codeobj_171 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_165, __pyx_n_s__decode_sentence, 118, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_171)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__86 = PyTuple_Pack(3, __pyx_n_s_lattice, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_3, __pyx_n_s_decode_sentence, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":121 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":121 * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) * * def encode_words(words): # <<<<<<<<<<<<<< * return tuple(sym_fromstring(word, True) for word in words) * */ - __pyx_k_tuple_172 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__words), ((PyObject *)__pyx_n_s__genexpr), ((PyObject *)__pyx_n_s__genexpr)); if (unlikely(!__pyx_k_tuple_172)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_172); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_172)); - __pyx_k_codeobj_173 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_165, __pyx_n_s__encode_words, 121, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_173)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__88 = PyTuple_Pack(3, __pyx_n_s_words, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_3, __pyx_n_s_encode_words, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":124 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":124 * return tuple(sym_fromstring(word, True) for word in words) * * def decode_words(syms): # <<<<<<<<<<<<<< * return tuple(sym_tostring(sym) for sym in syms) */ - __pyx_k_tuple_174 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__syms), ((PyObject *)__pyx_n_s__genexpr), ((PyObject *)__pyx_n_s__genexpr)); if (unlikely(!__pyx_k_tuple_174)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_174); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_174)); - __pyx_k_codeobj_175 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_165, __pyx_n_s__decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_175)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__90 = PyTuple_Pack(3, __pyx_n_s_syms, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt_3, __pyx_n_s_decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2183 * * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_177 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_177); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_177)); - __pyx_k_codeobj_178 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_check, 2171, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__92 = PyTuple_Pack(4, __pyx_n_s_vec, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt, __pyx_n_s_span_check, 2183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2191 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_179 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_179); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_179)); - __pyx_k_codeobj_180 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_inc, 2179, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_180)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__94 = PyTuple_Pack(4, __pyx_n_s_vec, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt, __pyx_n_s_span_inc, 2191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/rulefactory.pxi":2197 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_181 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_181)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_181); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_181)); - __pyx_k_codeobj_182 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_dec, 2185, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_182)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__96 = PyTuple_Pack(4, __pyx_n_s_vec, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_mdenkows_cdec_git_pyt, __pyx_n_s_span_dec, 2197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -75773,16 +78185,16 @@ static int __Pyx_InitCachedConstants(void) { static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -75841,14 +78253,6 @@ PyMODINIT_FUNC PyInit__sa(void) if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!PyDict_GetItemString(modules, "cdec.sa._sa")) { - if (unlikely(PyDict_SetItemString(modules, "cdec.sa._sa", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - } - #endif __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__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); @@ -75860,8 +78264,16 @@ PyMODINIT_FUNC PyInit__sa(void) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_cdec__sa___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;}; + 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;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "cdec.sa._sa")) { + if (unlikely(PyDict_SetItemString(modules, "cdec.sa._sa", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } } + #endif /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ @@ -75876,30 +78288,15 @@ PyMODINIT_FUNC PyInit__sa(void) if (__Pyx_ExportFunction("sym_isvar", (void (*)(void))__pyx_f_4cdec_2sa_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_4cdec_2sa_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 ---*/ - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_FeatureVector) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "FeatureVector", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_FeatureVector) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_FeatureVector = &__pyx_type_4cdec_2sa_3_sa_FeatureVector; - __pyx_vtabptr_4cdec_2sa_3_sa_SuffixArray = &__pyx_vtable_4cdec_2sa_3_sa_SuffixArray; - __pyx_vtable_4cdec_2sa_3_sa_SuffixArray.__pyx___search_high = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *, int, int, int, int))__pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high; - __pyx_vtable_4cdec_2sa_3_sa_SuffixArray.__pyx___search_low = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *, int, int, int, int))__pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low; - __pyx_vtable_4cdec_2sa_3_sa_SuffixArray.__pyx___get_range = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *, int, int, int, int, int))__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range; - __pyx_vtable_4cdec_2sa_3_sa_SuffixArray.__pyx___lookup_helper = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *, int, int, int, int))__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_SuffixArray.tp_dict, __pyx_vtabptr_4cdec_2sa_3_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_4cdec_2sa_3_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_SuffixArray = &__pyx_type_4cdec_2sa_3_sa_SuffixArray; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule; - if (PyType_Ready(&__pyx_type_4cdec_2sa_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_4cdec_2sa_3_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_LCP = &__pyx_type_4cdec_2sa_3_sa_LCP; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "OnlineStats", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_OnlineStats = &__pyx_type_4cdec_2sa_3_sa_OnlineStats; + __pyx_vtabptr_4cdec_2sa_3_sa_FloatList = &__pyx_vtable_4cdec_2sa_3_sa_FloatList; + __pyx_vtable_4cdec_2sa_3_sa_FloatList.set = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, int, float))__pyx_f_4cdec_2sa_3_sa_9FloatList_set; + __pyx_vtable_4cdec_2sa_3_sa_FloatList.write_handle = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, FILE *))__pyx_f_4cdec_2sa_3_sa_9FloatList_write_handle; + __pyx_vtable_4cdec_2sa_3_sa_FloatList.read_handle = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, FILE *))__pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_FloatList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_FloatList.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_FloatList.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_FloatList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_FloatList = &__pyx_type_4cdec_2sa_3_sa_FloatList; __pyx_vtabptr_4cdec_2sa_3_sa_IntList = &__pyx_vtable_4cdec_2sa_3_sa_IntList; __pyx_vtable_4cdec_2sa_3_sa_IntList.set = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, int, int))__pyx_f_4cdec_2sa_3_sa_7IntList_set; __pyx_vtable_4cdec_2sa_3_sa_IntList._append = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, int))__pyx_f_4cdec_2sa_3_sa_7IntList__append; @@ -75909,134 +78306,88 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_vtable_4cdec_2sa_3_sa_IntList.write_handle = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, FILE *))__pyx_f_4cdec_2sa_3_sa_7IntList_write_handle; __pyx_vtable_4cdec_2sa_3_sa_IntList.read_handle = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, FILE *))__pyx_f_4cdec_2sa_3_sa_7IntList_read_handle; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_IntList) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_IntList.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_IntList.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_IntList) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_IntList = &__pyx_type_4cdec_2sa_3_sa_IntList; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_FeatureVector) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_FeatureVector.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "FeatureVector", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_FeatureVector) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_FeatureVector = &__pyx_type_4cdec_2sa_3_sa_FeatureVector; __pyx_vtabptr_4cdec_2sa_3_sa_Phrase = &__pyx_vtable_4cdec_2sa_3_sa_Phrase; __pyx_vtable_4cdec_2sa_3_sa_Phrase.chunkpos = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *, int))__pyx_f_4cdec_2sa_3_sa_6Phrase_chunkpos; __pyx_vtable_4cdec_2sa_3_sa_Phrase.chunklen = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *, int))__pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_Phrase.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Phrase.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_Phrase = &__pyx_type_4cdec_2sa_3_sa_Phrase; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_TrieNode = &__pyx_type_4cdec_2sa_3_sa_TrieNode; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases; - __pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode.tp_base = __pyx_ptype_4cdec_2sa_3_sa_TrieNode; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode = &__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_Rule.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "Rule", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_Rule = &__pyx_type_4cdec_2sa_3_sa_Rule; + __pyx_vtabptr_4cdec_2sa_3_sa_StringMap = &__pyx_vtable_4cdec_2sa_3_sa_StringMap; + __pyx_vtable_4cdec_2sa_3_sa_StringMap.word = (char *(*)(struct __pyx_obj_4cdec_2sa_3_sa_StringMap *, int))__pyx_f_4cdec_2sa_3_sa_9StringMap_word; + __pyx_vtable_4cdec_2sa_3_sa_StringMap.index = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_StringMap *, char *))__pyx_f_4cdec_2sa_3_sa_9StringMap_index; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_StringMap) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_StringMap.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_StringMap.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_StringMap) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_StringMap = &__pyx_type_4cdec_2sa_3_sa_StringMap; + __pyx_vtabptr_4cdec_2sa_3_sa_DataArray = &__pyx_vtable_4cdec_2sa_3_sa_DataArray; + __pyx_vtable_4cdec_2sa_3_sa_DataArray.read_handle = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *, FILE *))__pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle; + __pyx_vtable_4cdec_2sa_3_sa_DataArray.write_handle = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *, FILE *))__pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_DataArray) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_DataArray.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_DataArray.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_DataArray) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_DataArray = &__pyx_type_4cdec_2sa_3_sa_DataArray; __pyx_vtabptr_4cdec_2sa_3_sa_Alignment = &__pyx_vtable_4cdec_2sa_3_sa_Alignment; __pyx_vtable_4cdec_2sa_3_sa_Alignment.link = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *, int, int))__pyx_f_4cdec_2sa_3_sa_9Alignment_link; __pyx_vtable_4cdec_2sa_3_sa_Alignment._unlink = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *, int, int *, int *))__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink; __pyx_vtable_4cdec_2sa_3_sa_Alignment._get_sent_links = (int *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *, int, int *))__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_Alignment.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Alignment.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "Alignment", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_Alignment = &__pyx_type_4cdec_2sa_3_sa_Alignment; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_input = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Rule", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_Rule = &__pyx_type_4cdec_2sa_3_sa_Rule; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr; - __pyx_vtabptr_4cdec_2sa_3_sa_Precomputation = &__pyx_vtable_4cdec_2sa_3_sa_Precomputation; - __pyx_vtable_4cdec_2sa_3_sa_Precomputation.read_map = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *, FILE *))__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map; - __pyx_vtable_4cdec_2sa_3_sa_Precomputation.write_map = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *, PyObject *, FILE *))__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Precomputation) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Precomputation.tp_dict, __pyx_vtabptr_4cdec_2sa_3_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_4cdec_2sa_3_sa_Precomputation) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_Precomputation = &__pyx_type_4cdec_2sa_3_sa_Precomputation; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance; - __pyx_vtabptr_4cdec_2sa_3_sa_TrieMap = &__pyx_vtable_4cdec_2sa_3_sa_TrieMap; - __pyx_vtable_4cdec_2sa_3_sa_TrieMap._insert = (struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *(*)(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *, int *, int))__pyx_f_4cdec_2sa_3_sa_7TrieMap__insert; - __pyx_vtable_4cdec_2sa_3_sa_TrieMap._contains = (struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *(*)(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *, int *, int))__pyx_f_4cdec_2sa_3_sa_7TrieMap__contains; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieMap) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_TrieMap.tp_dict, __pyx_vtabptr_4cdec_2sa_3_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_4cdec_2sa_3_sa_TrieMap) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_TrieMap = &__pyx_type_4cdec_2sa_3_sa_TrieMap; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments; + __pyx_vtabptr_4cdec_2sa_3_sa_BiLex = &__pyx_vtable_4cdec_2sa_3_sa_BiLex; + __pyx_vtable_4cdec_2sa_3_sa_BiLex.compute_from_data = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *, struct __pyx_obj_4cdec_2sa_3_sa_DataArray *, struct __pyx_obj_4cdec_2sa_3_sa_Alignment *))__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data; + __pyx_vtable_4cdec_2sa_3_sa_BiLex._add_node = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, struct __pyx_t_4cdec_2sa_3_sa__node *, int *, float, int *))__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node; + __pyx_vtable_4cdec_2sa_3_sa_BiLex.write_wordlist = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, PyObject *, FILE *))__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist; + __pyx_vtable_4cdec_2sa_3_sa_BiLex.read_wordlist = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, PyObject *, PyObject *, FILE *))__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist; + __pyx_vtable_4cdec_2sa_3_sa_BiLex.swap = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, int, int))__pyx_f_4cdec_2sa_3_sa_5BiLex_swap; + __pyx_vtable_4cdec_2sa_3_sa_BiLex.qsort = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, int, int, PyObject *))__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_BiLex) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_BiLex.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_BiLex.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_BiLex) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_BiLex = &__pyx_type_4cdec_2sa_3_sa_BiLex; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_BitSetIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_BitSetIterator.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "BitSetIterator", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_BitSetIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_BitSetIterator = &__pyx_type_4cdec_2sa_3_sa_BitSetIterator; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_BitSet) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_BitSet.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "BitSet", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_BitSet) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_BitSet = &__pyx_type_4cdec_2sa_3_sa_BitSet; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_VEBIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_VEBIterator.tp_print = 0; if (__Pyx_SetAttrString(__pyx_m, "VEBIterator", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_VEBIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_VEBIterator = &__pyx_type_4cdec_2sa_3_sa_VEBIterator; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr; - __pyx_vtabptr_4cdec_2sa_3_sa_FloatList = &__pyx_vtable_4cdec_2sa_3_sa_FloatList; - __pyx_vtable_4cdec_2sa_3_sa_FloatList.set = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, int, float))__pyx_f_4cdec_2sa_3_sa_9FloatList_set; - __pyx_vtable_4cdec_2sa_3_sa_FloatList.write_handle = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, FILE *))__pyx_f_4cdec_2sa_3_sa_9FloatList_write_handle; - __pyx_vtable_4cdec_2sa_3_sa_FloatList.read_handle = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, FILE *))__pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_FloatList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_FloatList.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_FloatList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_FloatList = &__pyx_type_4cdec_2sa_3_sa_FloatList; - __pyx_vtabptr_4cdec_2sa_3_sa_StringMap = &__pyx_vtable_4cdec_2sa_3_sa_StringMap; - __pyx_vtable_4cdec_2sa_3_sa_StringMap.word = (char *(*)(struct __pyx_obj_4cdec_2sa_3_sa_StringMap *, int))__pyx_f_4cdec_2sa_3_sa_9StringMap_word; - __pyx_vtable_4cdec_2sa_3_sa_StringMap.index = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_StringMap *, char *))__pyx_f_4cdec_2sa_3_sa_9StringMap_index; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_StringMap) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_StringMap.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_StringMap) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_StringMap = &__pyx_type_4cdec_2sa_3_sa_StringMap; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_TrieTable = &__pyx_type_4cdec_2sa_3_sa_TrieTable; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr; __pyx_vtabptr_4cdec_2sa_3_sa_VEB = &__pyx_vtable_4cdec_2sa_3_sa_VEB; __pyx_vtable_4cdec_2sa_3_sa_VEB._findsucc = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_VEB *, int))__pyx_f_4cdec_2sa_3_sa_3VEB__findsucc; __pyx_vtable_4cdec_2sa_3_sa_VEB._insert = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_VEB *, int))__pyx_f_4cdec_2sa_3_sa_3VEB__insert; __pyx_vtable_4cdec_2sa_3_sa_VEB._first = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_VEB *))__pyx_f_4cdec_2sa_3_sa_3VEB__first; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_VEB) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_VEB.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_VEB.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_VEB) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_VEB = &__pyx_type_4cdec_2sa_3_sa_VEB; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice; - __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation = &__pyx_vtable_4cdec_2sa_3_sa_PhraseLocation; - __pyx_vtable_4cdec_2sa_3_sa_PhraseLocation.contains = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *, int))__pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation = &__pyx_type_4cdec_2sa_3_sa_PhraseLocation; - __pyx_vtabptr_4cdec_2sa_3_sa_Scorer = &__pyx_vtable_4cdec_2sa_3_sa_Scorer; - __pyx_vtable_4cdec_2sa_3_sa_Scorer.score = (struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Scorer *, PyObject *))__pyx_f_4cdec_2sa_3_sa_6Scorer_score; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Scorer) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Scorer.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_Scorer) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Scorer", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Scorer) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_Scorer = &__pyx_type_4cdec_2sa_3_sa_Scorer; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_Sampler = &__pyx_type_4cdec_2sa_3_sa_Sampler; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_LCP.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "LCP", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_LCP = &__pyx_type_4cdec_2sa_3_sa_LCP; __pyx_vtabptr_4cdec_2sa_3_sa_Alphabet = &__pyx_vtable_4cdec_2sa_3_sa_Alphabet; __pyx_vtable_4cdec_2sa_3_sa_Alphabet.isvar = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *, int))__pyx_f_4cdec_2sa_3_sa_8Alphabet_isvar; __pyx_vtable_4cdec_2sa_3_sa_Alphabet.isword = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *, int))__pyx_f_4cdec_2sa_3_sa_8Alphabet_isword; @@ -76049,30 +78400,64 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_vtable_4cdec_2sa_3_sa_Alphabet.tostring = (char *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *, int))__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring; __pyx_vtable_4cdec_2sa_3_sa_Alphabet.fromstring = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *, char *, int))__pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Alphabet) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_Alphabet.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Alphabet.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_Alphabet) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_Alphabet = &__pyx_type_4cdec_2sa_3_sa_Alphabet; - __pyx_vtabptr_4cdec_2sa_3_sa_BiLex = &__pyx_vtable_4cdec_2sa_3_sa_BiLex; - __pyx_vtable_4cdec_2sa_3_sa_BiLex.compute_from_data = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *, struct __pyx_obj_4cdec_2sa_3_sa_DataArray *, struct __pyx_obj_4cdec_2sa_3_sa_Alignment *))__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data; - __pyx_vtable_4cdec_2sa_3_sa_BiLex._add_node = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, struct __pyx_t_4cdec_2sa_3_sa__node *, int *, float, int *))__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node; - __pyx_vtable_4cdec_2sa_3_sa_BiLex.write_wordlist = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, PyObject *, FILE *))__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist; - __pyx_vtable_4cdec_2sa_3_sa_BiLex.read_wordlist = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, PyObject *, PyObject *, FILE *))__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist; - __pyx_vtable_4cdec_2sa_3_sa_BiLex.swap = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, int, int))__pyx_f_4cdec_2sa_3_sa_5BiLex_swap; - __pyx_vtable_4cdec_2sa_3_sa_BiLex.qsort = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_BiLex *, int, int, PyObject *))__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_BiLex) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_BiLex.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_BiLex) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_BiLex = &__pyx_type_4cdec_2sa_3_sa_BiLex; - __pyx_vtabptr_4cdec_2sa_3_sa_DataArray = &__pyx_vtable_4cdec_2sa_3_sa_DataArray; - __pyx_vtable_4cdec_2sa_3_sa_DataArray.read_handle = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *, FILE *))__pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle; - __pyx_vtable_4cdec_2sa_3_sa_DataArray.write_handle = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_DataArray *, FILE *))__pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_DataArray) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_DataArray.tp_dict, __pyx_vtabptr_4cdec_2sa_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_4cdec_2sa_3_sa_DataArray) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_DataArray = &__pyx_type_4cdec_2sa_3_sa_DataArray; - if (PyType_Ready(&__pyx_type_4cdec_2sa_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_4cdec_2sa_3_sa_BitSetIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_BitSetIterator = &__pyx_type_4cdec_2sa_3_sa_BitSetIterator; + __pyx_vtabptr_4cdec_2sa_3_sa_TrieMap = &__pyx_vtable_4cdec_2sa_3_sa_TrieMap; + __pyx_vtable_4cdec_2sa_3_sa_TrieMap._insert = (struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *(*)(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *, int *, int))__pyx_f_4cdec_2sa_3_sa_7TrieMap__insert; + __pyx_vtable_4cdec_2sa_3_sa_TrieMap._contains = (struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *(*)(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *, int *, int))__pyx_f_4cdec_2sa_3_sa_7TrieMap__contains; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieMap) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_TrieMap.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_TrieMap.tp_dict, __pyx_vtabptr_4cdec_2sa_3_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_4cdec_2sa_3_sa_TrieMap) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_TrieMap = &__pyx_type_4cdec_2sa_3_sa_TrieMap; + __pyx_vtabptr_4cdec_2sa_3_sa_Precomputation = &__pyx_vtable_4cdec_2sa_3_sa_Precomputation; + __pyx_vtable_4cdec_2sa_3_sa_Precomputation.read_map = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *, FILE *))__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map; + __pyx_vtable_4cdec_2sa_3_sa_Precomputation.write_map = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *, PyObject *, FILE *))__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Precomputation) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_Precomputation.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Precomputation.tp_dict, __pyx_vtabptr_4cdec_2sa_3_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_4cdec_2sa_3_sa_Precomputation) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_Precomputation = &__pyx_type_4cdec_2sa_3_sa_Precomputation; + __pyx_vtabptr_4cdec_2sa_3_sa_SuffixArray = &__pyx_vtable_4cdec_2sa_3_sa_SuffixArray; + __pyx_vtable_4cdec_2sa_3_sa_SuffixArray.__pyx___search_high = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *, int, int, int, int))__pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high; + __pyx_vtable_4cdec_2sa_3_sa_SuffixArray.__pyx___search_low = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *, int, int, int, int))__pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low; + __pyx_vtable_4cdec_2sa_3_sa_SuffixArray.__pyx___get_range = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *, int, int, int, int, int))__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range; + __pyx_vtable_4cdec_2sa_3_sa_SuffixArray.__pyx___lookup_helper = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *, int, int, int, int))__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_SuffixArray.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_SuffixArray.tp_dict, __pyx_vtabptr_4cdec_2sa_3_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_4cdec_2sa_3_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_SuffixArray = &__pyx_type_4cdec_2sa_3_sa_SuffixArray; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_OnlineStats.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "OnlineStats", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_OnlineStats = &__pyx_type_4cdec_2sa_3_sa_OnlineStats; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_TrieNode.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_TrieNode = &__pyx_type_4cdec_2sa_3_sa_TrieNode; + __pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode.tp_base = __pyx_ptype_4cdec_2sa_3_sa_TrieNode; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode = &__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_TrieTable.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_TrieTable = &__pyx_type_4cdec_2sa_3_sa_TrieTable; + __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation = &__pyx_vtable_4cdec_2sa_3_sa_PhraseLocation; + __pyx_vtable_4cdec_2sa_3_sa_PhraseLocation.contains = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *, int))__pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_PhraseLocation.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation = &__pyx_type_4cdec_2sa_3_sa_PhraseLocation; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_Sampler.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_Sampler = &__pyx_type_4cdec_2sa_3_sa_Sampler; __pyx_vtabptr_4cdec_2sa_3_sa_HieroCachingRuleFactory = &__pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory; __pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory.set_idmap = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_4cdec_2sa_3_sa_DataArray *))__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap; __pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory.baeza_yates_helper = (int *(*)(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *, int, int, int *, int, int, int, int *, int, int, int, int, int *))__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper; @@ -76090,24 +78475,107 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory.create_alignments = (struct __pyx_obj_4cdec_2sa_3_sa_IntList *(*)(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *, int *, int, struct __pyx_obj_4cdec_2sa_3_sa_IntList *, struct __pyx_obj_4cdec_2sa_3_sa_IntList *))__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_create_alignments; __pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory.extract = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_4cdec_2sa_3_sa_Phrase *, struct __pyx_t_4cdec_2sa_3_sa_Matching *, int *, int))__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4cdec_2sa_3_sa_HieroCachingRuleFactory = &__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats; - if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr; + __pyx_vtabptr_4cdec_2sa_3_sa_Scorer = &__pyx_vtable_4cdec_2sa_3_sa_Scorer; + __pyx_vtable_4cdec_2sa_3_sa_Scorer.score = (struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Scorer *, PyObject *))__pyx_f_4cdec_2sa_3_sa_6Scorer_score; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Scorer) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa_Scorer.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Scorer.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_Scorer) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Scorer", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Scorer) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_Scorer = &__pyx_type_4cdec_2sa_3_sa_Scorer; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct____iter__) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct____iter__.tp_print = 0; __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct____iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct____iter__; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr.tp_print = 0; __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr; - if (PyType_Ready(&__pyx_type_4cdec_2sa_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_4cdec_2sa_3_sa_BitSet) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_BitSet = &__pyx_type_4cdec_2sa_3_sa_BitSet; if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence.tp_print = 0; __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_input = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__; + if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr.tp_print = 0; + __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ @@ -76118,9 +78586,9 @@ PyMODINIT_FUNC PyInit__sa(void) * import resource * import gzip */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__logging), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__logging, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __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/_sa.pyx":2 @@ -76129,9 +78597,9 @@ PyMODINIT_FUNC PyInit__sa(void) * import gzip * */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__resource), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(__pyx_n_s_resource, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__resource, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __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/_sa.pyx":3 @@ -76141,9 +78609,9 @@ PyMODINIT_FUNC PyInit__sa(void) * * def monitor_cpu(): */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__gzip), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gzip, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__gzip, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __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/_sa.pyx":5 @@ -76153,9 +78621,9 @@ PyMODINIT_FUNC PyInit__sa(void) * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ * resource.getrusage(resource.RUSAGE_SELF).ru_stime) */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_1monitor_cpu, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_1monitor_cpu, NULL, __pyx_n_s_cdec_sa__sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__monitor_cpu, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_monitor_cpu, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cdec/sa/_sa.pyx":9 @@ -76165,9 +78633,9 @@ PyMODINIT_FUNC PyInit__sa(void) * if filename.endswith('.gz'): * return gzip.GzipFile(filename) */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_3gzip_or_text, NULL, __pyx_n_s_102); 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_4cdec_2sa_3_sa_3gzip_or_text, NULL, __pyx_n_s_cdec_sa__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 (PyDict_SetItem(__pyx_d, __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;} + if (PyDict_SetItem(__pyx_d, __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/_sa.pyx":15 @@ -76177,18 +78645,18 @@ PyMODINIT_FUNC PyInit__sa(void) * * include "float_list.pxi" */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_162), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s__logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mdenkows/cdec/python/cdec/sa/alignment.pxi":8 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/alignment.pxi":8 * # May need to revisit if things get really tight, though. * * cdef int ALIGNMENT_CODE = 1 << 16 # <<<<<<<<<<<<<< @@ -76197,20 +78665,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE = 65536; - /* "/home/mdenkows/cdec/python/cdec/sa/bilex.pxi":54 - * cdef id2eword, id2fword, eword2id, fword2id - * - * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< - * earray=None, fsarray=None, alignment=None): - * self.id2eword = [] - */ - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_k_43 = __pyx_t_1; - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":17 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":17 * from libc.string cimport memset * * cdef int MIN_BOTTOM_SIZE = 32 # <<<<<<<<<<<<<< @@ -76219,7 +78674,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE = 32; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":18 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":18 * * cdef int MIN_BOTTOM_SIZE = 32 * cdef int MIN_BOTTOM_BITS = 5 # <<<<<<<<<<<<<< @@ -76228,7 +78683,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS = 5; - /* "/home/mdenkows/cdec/python/cdec/sa/veb.pxi":28 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/veb.pxi":28 * LOWER_MASK[i] = mask * * _init_lower_mask() # <<<<<<<<<<<<<< @@ -76237,7 +78692,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_f_4cdec_2sa_3_sa__init_lower_mask(); - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":4 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":4 * from libc.stdlib cimport malloc, realloc, strtol * * cdef int INDEX_SHIFT = 3 # <<<<<<<<<<<<<< @@ -76246,7 +78701,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_4cdec_2sa_3_sa_INDEX_SHIFT = 3; - /* "/home/mdenkows/cdec/python/cdec/sa/sym.pxi":5 + /* "/usr0/home/mdenkows/cdec-git/python/cdec/sa/sym.pxi":5 * * cdef int INDEX_SHIFT = 3 * cdef int INDEX_MASK = (1<= 3 "name '%U' is not defined", name); #else - "name '%s' is not defined", PyString_AS_STRING(name)); + "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; @@ -76709,6 +79167,29 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { return result; } +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) @@ -76808,12 +79289,12 @@ arg_passed_twice: goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); + "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", + "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", @@ -76843,7 +79324,7 @@ static void __Pyx_RaiseArgtupleInvalid( more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, - "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)", + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } @@ -76965,27 +79446,40 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyEval_CallObject(type, args); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } } } else { PyErr_SetString(PyExc_TypeError, @@ -77032,10 +79526,18 @@ bad: #endif static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, - CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) { + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else @@ -77052,7 +79554,7 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { - PyErr_Format(PyExc_SystemError, "Missing type object"); + PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) @@ -77086,13 +79588,13 @@ static CYTHON_INLINE int __Pyx_CheckKeywordStrings( return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); + "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", + "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", @@ -77101,6 +79603,128 @@ invalid_keyword: return 0; } +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; @@ -77179,14 +79803,47 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { - if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return NULL; - Py_INCREF(Py_None); - return Py_None; /* this is just to have an accurate signature */ + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { - return __Pyx_PyObject_CallMethod1(L, __pyx_n_s__append, x); + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); } + return 0; +} + +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; + *tb = tstate->exc_traceback; + 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; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { @@ -77211,12 +79868,14 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif goto bad; #if PY_MAJOR_VERSION >= 3 - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } #endif - Py_INCREF(local_type); - Py_INCREF(local_value); - Py_INCREF(local_tb); + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; @@ -77227,8 +79886,6 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (DECREF may run arbitrary code). */ Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); @@ -77367,7 +80024,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack", + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } @@ -77514,26 +80171,38 @@ static CYTHON_INLINE long __Pyx_div_long(long a, long b) { return q; } -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { - if (Py_TYPE(obj) == type) return 1; + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif } else { - if (PyObject_TypeCheck(obj, type)) return 1; + if (likely(PyObject_TypeCheck(obj, type))) return 1; } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL) +} +#endif + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } @@ -77694,6 +80363,44 @@ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { return r; } +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { @@ -77826,11 +80533,10 @@ __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) return 0; } static PyObject * -__Pyx_CyFunction_get_globals(CYTHON_UNUSED __pyx_CyFunctionObject *op) +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { - PyObject* dict = PyModule_GetDict(__pyx_m); - Py_XINCREF(dict); - return dict; + Py_INCREF(op->func_globals); + return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) @@ -77986,7 +80692,7 @@ static PyMethodDef __pyx_CyFunction_methods[] = { {0, 0, 0, 0} }; static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* code) { + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; @@ -78004,6 +80710,8 @@ static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int f op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; @@ -78024,6 +80732,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); @@ -78055,6 +80764,7 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); @@ -78199,7 +80909,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif -#if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) +#if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; @@ -78207,9 +80917,10 @@ static int __Pyx_CyFunction_init(void) { #if !CYTHON_COMPILING_IN_PYPY __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; #endif - if (PyType_Ready(&__pyx_CyFunctionType_type) < 0) + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { return -1; - __pyx_CyFunctionType = &__pyx_CyFunctionType_type; + } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { @@ -78237,20 +80948,50 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py Py_INCREF(dict); } -static CYTHON_INLINE PyObject* __Pyx_PyObject_Pop(PyObject* L) { +static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02050000 + if (Py_TYPE(L) == &PySet_Type) { + return PySet_Pop(L); + } +#endif + return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); +} +static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02040000 - if (likely(PyList_CheckExact(L)) - && likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { + if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { Py_SIZE(L) -= 1; return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); } -#if PY_VERSION_HEX >= 0x02050000 - else if (Py_TYPE(L) == (&PySet_Type)) { - return PySet_Pop(L); - } #endif + return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); +} + +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, Py_ssize_t ix) { + PyObject *r, *py_ix; + py_ix = PyInt_FromSsize_t(ix); + if (!py_ix) return NULL; + r = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); + Py_DECREF(py_ix); + return r; +} +static PyObject* __Pyx_PyList_PopIndex(PyObject* L, Py_ssize_t ix) { +#if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = PyList_GET_SIZE(L); + if (likely(size > (((PyListObject*)L)->allocated >> 1))) { + Py_ssize_t cix = ix; + if (cix < 0) { + cix += size; + } + if (likely(0 <= cix && cix < size)) { + PyObject* v = PyList_GET_ITEM(L, cix); + Py_SIZE(L) -= 1; + size -= 1; + memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size-cix)*sizeof(PyObject*)); + return v; + } + } #endif - return __Pyx_PyObject_CallMethod0(L, __pyx_n_s__pop); + return __Pyx__PyObject_PopIndex(L, ix); } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { @@ -78261,7 +81002,7 @@ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #endif if (!ob) goto bad; - if (PyDict_SetItem(dict, __pyx_n_s____pyx_vtable__, ob) < 0) + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; @@ -78283,35 +81024,146 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { return value; } -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; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -#else - PyErr_GetExcInfo(type, value, tb); -#endif +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } } -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; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - PyErr_SetExcInfo(type, value, tb); + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } #endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { @@ -78322,7 +81174,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__); + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif @@ -78396,557 +81248,253 @@ bad: return module; } -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif #endif -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { + const unsigned int neg_one = (unsigned int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; + if (sizeof(unsigned int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned int"); + return (unsigned int) -1; + } + return (unsigned int) val; } - return (unsigned long)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(unsigned int)) { switch (Py_SIZE(x)) { case 0: return 0; - case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0]; + case 1: return (unsigned int) ((PyLongObject*)x)->ob_digit[0]; } } -#endif + #endif #endif if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; + "can't convert negative value to unsigned int"); + return (unsigned int) -1; + } + if (sizeof(unsigned int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(unsigned int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long long, PyLong_AsUnsignedLongLong) } - return (unsigned long)PyLong_AsUnsignedLong(x); } else { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(unsigned int)) { switch (Py_SIZE(x)) { case 0: return 0; - case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0]; + case 1: return +(unsigned int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(unsigned int) ((PyLongObject*)x)->ob_digit[0]; } } + #endif #endif -#endif - return (unsigned long)PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } + if (sizeof(unsigned int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, PyLong_AsLong) + } else if (sizeof(unsigned int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long long, PyLong_AsLongLong) } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); } - return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; } #endif -#endif - return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x); + return (unsigned int) -1; } } else { - unsigned PY_LONG_LONG val; + unsigned int val; PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); + if (!tmp) return (unsigned int) -1; + val = __Pyx_PyInt_As_unsigned_int(tmp); Py_DECREF(tmp); return val; } } -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { + const unsigned int neg_one = (unsigned int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (long)PyLong_AsLong(x); + if (is_unsigned) { + if (sizeof(unsigned int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(unsigned int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); } } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; + if (sizeof(unsigned int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(unsigned int), + little, !is_unsigned); } } -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (PY_LONG_LONG)PyLong_AsLongLong(x); + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); } } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); } } #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif #endif -#endif -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; } - return (signed long)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { switch (Py_SIZE(x)) { case 0: return 0; - case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0]; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; } } -#endif + #endif #endif if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) } - return (signed long)PyLong_AsUnsignedLong(x); } else { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { switch (Py_SIZE(x)) { case 0: return 0; - case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0]; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; } } + #endif #endif -#endif - return (signed long)PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); } - return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; } #endif -#endif - return (signed PY_LONG_LONG)PyLong_AsLongLong(x); + return (long) -1; } } else { - signed PY_LONG_LONG val; + long val; PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } @@ -79020,7 +81568,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { Py_DECREF(ev); #else { - PyObject* args = PyObject_GetAttr(ev, __pyx_n_s__args); + PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args); Py_DECREF(ev); if (likely(args)) { value = PyObject_GetItem(args, 0); @@ -79156,7 +81704,7 @@ static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) { if (value == Py_None) ret = PyIter_Next(yf); else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s__send, value); + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); } gen->is_running = 0; if (likely(ret)) { @@ -79176,7 +81724,7 @@ static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) { } else { PyObject *meth; gen->is_running = 1; - meth = PyObject_GetAttr(yf, __pyx_n_s__close); + meth = PyObject_GetAttr(yf, __pyx_n_s_close); if (unlikely(!meth)) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_WriteUnraisable(yf); @@ -79261,7 +81809,7 @@ static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) { if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Throw(yf, args); } else { - PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s__throw); + PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -79312,13 +81860,17 @@ static void __Pyx_Generator_dealloc(PyObject *self) { PyObject_GC_UnTrack(gen); if (gen->gi_weakreflist != NULL) PyObject_ClearWeakRefs(self); - PyObject_GC_Track(self); if (gen->resume_label > 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 + if (PyObject_CallFinalizerFromDealloc(self)) +#else Py_TYPE(gen)->tp_del(self); if (self->ob_refcnt > 0) +#endif return; /* resurrected. :( */ + PyObject_GC_UnTrack(self); } - PyObject_GC_UnTrack(self); __Pyx_Generator_clear(self); PyObject_GC_Del(gen); } @@ -79328,8 +81880,10 @@ static void __Pyx_Generator_del(PyObject *self) { __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; if (gen->resume_label <= 0) return ; +#if PY_VERSION_HEX < 0x030400a1 assert(self->ob_refcnt == 0); self->ob_refcnt = 1; +#endif __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); res = __Pyx_Generator_Close(self); if (res == NULL) @@ -79337,6 +81891,7 @@ static void __Pyx_Generator_del(PyObject *self) { else Py_DECREF(res); __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if PY_VERSION_HEX < 0x030400a1 /* Undo the temporary resurrection; can't use DECREF here, it would * cause a recursive call. */ @@ -79368,6 +81923,7 @@ static void __Pyx_Generator_del(PyObject *self) { --Py_TYPE(self)->tp_frees; --Py_TYPE(self)->tp_allocs; #endif +#endif } static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", @@ -79411,7 +81967,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags*/ 0, /*tp_doc*/ (traverseproc) __Pyx_Generator_traverse, /*tp_traverse*/ 0, /*tp_clear*/ @@ -79437,12 +81993,16 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_del*/ +#else __Pyx_Generator_del, /*tp_del*/ +#endif #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif -#if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ +#if PY_VERSION_HEX >= 0x030400a1 + __Pyx_Generator_del, /*tp_finalize*/ #endif }; static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, @@ -79468,10 +82028,10 @@ static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, 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)) { + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + if (__pyx_GeneratorType == NULL) { return -1; } - __pyx_GeneratorType = &__pyx_GeneratorType_type; return 0; } @@ -79771,10 +82331,18 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_ #endif /* PY_VERSION_HEX < 0x03030000 */ } else #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); - if (r < 0) { + if (unlikely(r < 0)) { return NULL; } else { return result; @@ -79819,7 +82387,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", + "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; @@ -79831,9 +82399,35 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { } return res; } +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); @@ -79852,16 +82446,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); #endif } -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred()) - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} #endif /* Py_PYTHON_H */ diff --git a/python/cdec/sa/extractor.py b/python/cdec/sa/extractor.py index c2ded1d6..777f5afd 100644 --- a/python/cdec/sa/extractor.py +++ b/python/cdec/sa/extractor.py @@ -1,5 +1,7 @@ from itertools import chain -import os, sys +import logging +import os +import sys import cdec.configobj from cdec.sa._sa import gzip_or_text from cdec.sa.features import EgivenFCoherent, SampleCountF, CountEF,\ @@ -12,14 +14,31 @@ MAX_INITIAL_SIZE = 15 class GrammarExtractor: def __init__(self, config, online=False, features=None): + + logging.basicConfig(level=logging.INFO) + logger = logging.getLogger('cdec.sa') + if isinstance(config, basestring): if not os.path.exists(config): raise IOError('cannot read configuration from {0}'.format(config)) config = cdec.configobj.ConfigObj(config, unrepr=True) + + logger.info('Loading alignment...') alignment = cdec.sa.Alignment(from_binary=config['a_file']) + + # lexical weighting tables + if not online: + logger.info('Loading bilexical dictionary...') + tt = cdec.sa.BiLex(from_binary=config['lex_file']) + else: + logger.info('Loading online bilexical dictionary...') + tt = cdec.sa.online.Bilex(config['bilex_file']) + self.factory = cdec.sa.HieroCachingRuleFactory( # compiled alignment object (REQUIRED) alignment, + # bilexical dictionary if online + bilex=tt if online else None, # name of generic nonterminal used by Hiero category="[X]", # maximum number of contiguous chunks of terminal symbols in RHS of a rule @@ -56,12 +75,6 @@ class GrammarExtractor: tight_phrases=config.get('tight_phrases', True), ) - # lexical weighting tables - if not online: - tt = cdec.sa.BiLex(from_binary=config['lex_file']) - else: - tt = cdec.sa.online.Bilex(config['bilex_file']) - # TODO: clean this up # Load data and add features for online grammar extraction extended_features = [] diff --git a/python/cdec/sa/rulefactory.pxi b/python/cdec/sa/rulefactory.pxi index ca3321a4..635cca10 100644 --- a/python/cdec/sa/rulefactory.pxi +++ b/python/cdec/sa/rulefactory.pxi @@ -291,10 +291,13 @@ cdef class HieroCachingRuleFactory: cdef bint online cdef online_stats + cdef bilex def __cinit__(self, # compiled alignment object (REQUIRED) Alignment alignment, + # bilexical dictionary if online + bilex=None, # parameter for double-binary search; doesn't seem to matter much float by_slack_factor=1.0, # name of generic nonterminal used by Hiero @@ -400,7 +403,10 @@ cdef class HieroCachingRuleFactory: self.findexes1 = IntList(initial_len=10) # Online stats - + + # None if not online + self.bilex = bilex + # True after data is added self.online = False self.online_stats = defaultdict(OnlineStats) @@ -2039,6 +2045,12 @@ cdef class HieroCachingRuleFactory: stats.phrases_fe[f_ph][e_ph] += 1 if not stats.phrases_al[f_ph][e_ph]: stats.phrases_al[f_ph][e_ph] = al + + # Update bilexical dictionary (if exists) + if self.bilex: + self.bilex.update(f_words, e_words, alignment) + else: + logger.warning('No online bilexical dictionary specified, not updating lexical weights') # Create a rule from source, target, non-terminals, and alignments def form_rule(self, f_i, e_i, f_span, e_span, nt, al): -- cgit v1.2.3